-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nested schema inside object properties #379
Comments
The marshmallow plugin is not looking for marshmallow schemas nested within properties of a schema defined in a YAML. You can solve this two ways:
Hope that helps. |
Thanks @Bangertm. But I found marshmallow plugin is actually looking for marchmallow schema in the docstring, so schema:
type: object
properties:
addressInfo: AddressInfo this is works without importing AddressInfo schema manually . The only problem is, I can't write description in this way. schema:
type: object
properties:
addressInfos:
type: array
items: AddressInfoSchema
description: address infos description. I love apispec + marshmallow because of its flexibility which can fully use swagger spec, so how about support addressInfo:
$ref: AddressInfoSchema instead of this way? addressInfo: AddressInfoSchema IMO, with $ref, apispec can work with all feature of swagger and have much more flexibility.
manually binding schema has problem when AddressInfo is already registered by another route. Maybe |
Hi. Maybe I missed, I'm trying to nest a schema to object type
properties
, but I couldn't found the way to solve this situation.First I wrote below, but it doesn't work.
This is one of options, but it can't declare
description
manual binding is not working because AddressInfo is not in #/components/schema
Is there a proper solution for this? 🙏 Thanks.
The text was updated successfully, but these errors were encountered: