Closed phillim1 closed 2 years ago
Hello @phillim1.
I believe that both of the errors you're seeing above stem from the same problem. Taking your provided OpenAPI document, if I manually dereferencing just the #components/responses/BadRequest
we get this:
...
"paths": {
"/order-response": {
"post": {
...
"responses": {
...
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"description": "Bad Request",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
...
}
}
}
}
}
},
...
Notice that you have 400 > content > application/json > schema > content
which is not valid.
I hope that helps. Have a great day.
Thanks for the info.
Using the 1.15.4 version of openapi-enforcer with the attached API I get the following warnings/errors:
Attached API - openapi.json.txt
It looks as if the error is issued because of the 400 response defined with
$ref: '#/components/responses/BadRequest'
- this refers toresponses/BadRequest
which in turn refers to$ref: '#/components/schemas/Error'
.