Hi! It seems I might have been using the OpenAPI spec the wrong way - putting definitions field in schemas which is not supported by the spec. However, I haven't got any errors using swagger-cli validate due to the issue I describe below.
Swagger schema validation failed.
Data does not match any schemas from 'oneOf' at #/paths//route/get/requestBody
Data does not match any schemas from 'oneOf' at #/paths//route/get/requestBody/content/application/json/schema
Additional properties not allowed: definitions at #/content/application/json/schema
Missing required property: $ref at #/content/application/json/schema
Missing required property: $ref at #/paths//route/get/requestBody
JSON_OBJECT_VALIDATION_FAILED
While I have found some info that OpenAPI doesn't forbid circular references, this seems to be an error, because the definitions field should not be accepted at all.
Hi! It seems I might have been using the OpenAPI spec the wrong way - putting
definitions
field in schemas which is not supported by the spec. However, I haven't got any errors usingswagger-cli validate
due to the issue I describe below.Assume the main spec is:
Then there are 3 scenarios depending on the contents of
schema.yaml
.1. WORKS
2. FAILS
The error message is
3. WORKS
While I have found some info that OpenAPI doesn't forbid circular references, this seems to be an error, because the
definitions
field should not be accepted at all.