Currently, add_definition/1 always adds to the definitions: section in swagger.json and schema/1 hardcodes to fetch from <<"#/definitions/", DefinitionName/binary>>.
Structural error at
should NOT have additional properties
additionalProperty: definitions
Jump to line 0
This PR adds support to point add_definition/1 and schema/1 to "components" section if openapi: "3.0.0" is defined. For swagger: "2.0", it will still add to "definitions" section.
Currently,
add_definition/1
always adds to thedefinitions:
section in swagger.json andschema/1
hardcodes to fetch from<<"#/definitions/", DefinitionName/binary>>
.Open API 3.0.0 has removed the
#/definitions/
section and introduced#/components/schemas/
(Components Section)This causes:
This PR adds support to point
add_definition/1
andschema/1
to "components" section ifopenapi: "3.0.0"
is defined. Forswagger: "2.0"
, it will still add to "definitions" section.