Open MarcusAckermann opened 3 years ago
Hey, first of all, my apologies for a delayed response. In our case, the way you reference that header object is invalid. One should do
"headers": {
"Cache-Control" : {
"$ref": "#/components/headers/Cache-Control"
}
}
I do agree however that the error could be more meaningful.
I came across this error and it stumped me for a bit. For anyone else who has the same issue:
Change:
"headers": {
"Cache-Control" :{
"schema": {
"$ref": "#/components/headers/Cache-Control"
}
}
}
To:
"headers": {
"Cache-Control" :{
"$ref": "#/components/headers/Cache-Control"
}
}
It's easy to mix up, as schema often has an attribute $ref in other use cases. If the component has schema in it, then the object referencing it should not refer to it from a schema attribute. I think... if anyone posts additional info here, that'd help me out.
NOTE: only happens for version 3.0.1, it works fine in 3.1.0.
To Reproduce
schema
is not expected to be here. components.headers.Cache-Control.schema'Expected behavior According to https://swagger.io/specification/#header-object the property 'schema' is allowed in a header declaration. There should be no error regarding rule oas3-schema.
openapi.zip