-
Notifications
You must be signed in to change notification settings - Fork 502
Open
Description
I have a data structure with has nesting. I cannot get restplus to create a correct Swagger documentation. I tried
ns = api.namespace('calendars', description='Operations related to calendars')
availability = ns.model('Availability', {
'monday': fields.String(required=True, description='Availability of the therapist on Monday'),
})
calendar = ns.model('Calendar', {
'id': fields.Integer(readOnly=True, description='The unique identifier'),
'availability': fields.Nested(availability, description='The availability of the therapist during the week')
})
and
ns = api.namespace('calendars', description='Operations related to calendars')
availability = {
'monday': fields.String(required=True, description='Availability of the therapist on Monday'),
}
calendar = ns.model('Calendar', {
'id': fields.Integer(readOnly=True, description='The unique identifier'),
'availability': availability)
and
ns = api.namespace('calendars', description='Operations related to calendars')
availability = {
'monday': fields.String(required=True, description='Availability of the therapist on Monday'),
}
calendar = ns.model('Calendar', {
'id': fields.Integer(readOnly=True, description='The unique identifier'),
'availability': fields.Nested(availability, description='The availability of the therapist during the week')
})
In the first case the Availability model is not in the definitions of the swagger file. In the latter two, restplus seems to expect a model and not a dict. How do I define this correctly? Seems like a trivial data model to me.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels