Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
How to specify attributes (such as dump_only,...) on Nested fields? #108
Say you have a dump_only Nested field in your model.
The model reads:
class Parent(Schema): child = Nested(Child, dump_ony=True)
Assuming you added Child to the definitions, the spec then looks like
Unfortunately, this is invalid OpenAPI spec: swagger-api/swagger-js#402
I get this warning in ReDoc:
Has anyone here been facing this already?
Should we use the AllOf trick described here?
I tried to expose the issue in the tests, but apparently, the validation in swagger-tools does not raise any error about that, so I don't have a failing test.
Here's a quick fix attempt using