Closed clockfly closed 1 day ago
The spec in question is not a valid one.
If you open it in a schema-enabled editor, like the one included in intellij IDEs (e.g. GoLand), you'll see warnings.
The issue here is that OpenAPI 3.0 is based on JSON Schema draft 04, which does not allow any fields adjacent to $ref
.
This is also what is told by unmarshal error message (in a cryptic way though):
additional properties not allowed in SchemaReference: [nullable]]
Here are original and fixed schemas: openai-openapi.json Converted from the YAML original. openai-openapi-fixed.json Fixed to pass unmarshaling.
Describe the bug Unmarshal yaml failed for https://github.com/openai/openai-openapi/blob/master/openapi.yaml
Error:
To Reproduce
Expected behavior This file should be parsed correctly. This file renders correctly in swagger editor.
https://editor-next.swagger.io/
Additional context None