You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a response schema, if a nested field excludes fields from the schema that it nests, the swagger file generated by flask-rebar does not indicate that the excluded field will not be in the response.
Steps to reproduce
Define a schema similar to this
from marshmallow import fields
from flask_rebar.validation import ResponseSchema
class MyObjectSchema(ResponseSchema):
my_uid = fields.UUID(required=True)
my_field = fields.String(required=True)
class MyObjectListSchema(ResponseSchema):
results = fields.Nested(
MyObjectSchema,
exclude=("my_field",),
required=True,
many=True,
)
This will generate a swagger file with some of the following in it:
So, what this results in, when deserializing objects in a swagger-codegen generated client is the following ValueError gets raised
@my_field.setter
def my_field(self, my_field):
if my_field is None:
> raise ValueError("Invalid value for `my_field`, must not be `None`")
E ValueError: Invalid value for `my_field`, must not be `None`
The text was updated successfully, but these errors were encountered:
In a response schema, if a nested field excludes fields from the schema that it nests, the swagger file generated by flask-rebar does not indicate that the excluded field will not be in the response.
Steps to reproduce
Define a schema similar to this
This will generate a swagger file with some of the following in it:
So, what this results in, when deserializing objects in a swagger-codegen generated client is the following
ValueError
gets raisedThe text was updated successfully, but these errors were encountered: