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
{{ message }}
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2019. It is now read-only.
OpenAPI codec does not support definitions for nested objects #37
changed the title [-]OpenAPI codec does not support definitions for nested object[/-][+]OpenAPI codec does not support definitions for nested objects[/+]on Jun 10, 2017
If I understand correctly encode.py should be able to receive a coreschema.schemas.Schema object and return a dictionary as defined in the link above.
I wrote a function that does that to add the objects definitions in swagger, it is not complete but it meet my needs for now, it may be used as an initial commit to start supporting this, if you think this may be accepted into the project I can prepare a PR
If I understood correctly you are trying to autogenerate the definitions inside the encoder, my approach was that the document should already have a list of definitions, which in my case it was the user which defined manually, but they could as well be automatic, or a combination
I'm using the definitions for reference in the responses, so for now I am writing them manually and passing them to the Document object, the document object shouldn't care how the definitions list was created, much less the encoder.
Can you explain the logic of what you wrote? how are the definitions generated? what about field descriptions?
@tovmeod sorry for such a long delay answering to you. I'll clarify each step, but so far, you should not perform any manual steps creating definitions, but I'll be clear on that later on.
I made a function that create definitions using the serializer from each view, each serializer have two definitions, read and write, since there are read_only fields and also write_only fields
According to official spec, there's definitions objects.
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#definitionsObject
As a result of absence of definitions it's not possible to use references in generated schema.