Open MHarutunian opened 1 year ago
Thanks for reporting this!
Shouldn't it be like this though (added a missing "type: object"):
allOf:
- $ref: "#/components/schemas/ProblemDetails"
- type: object
properties:
validationErrors:
additionalProperties:
type: string
Thank you for the quick feedback! ~I can see that the error disappears if I add type: object
~ (EDIT: this is not true), but up until now my assumption was that type: object
would be implied in such cases, e.g. through the presence of properties
. I have no idea how I reached that assumption, but I can see that in our specification there are several models that don't explicitly define type: object
with a list of properties
, and no linter or renderer (including Redocly, Swagger and Microsoft Hidi) had any complaints thus far. So at the very least I think it's a bit confusing that this doesn't cause issues anywhere else, but then produces a somewhat misleading error message on this linting rule.
Looking at the official specification it seems that the type
is indeed optional, but it doesn't mention that object
would be the default. I checked both OpenAPI and the underlying JSON Schema spec, and they are not particularly clear about this, but it seems that the default would rather be any
(allowing any type), so I guess it's not a good idea to leave it out anyway.
EDIT: Actually I messed up, sorry. The error still comes up, even if I add type: object
, so while it might be a good idea to add it, it doesn't solve the issue.
Describe the bug The
operation-4xx-problem-details-rfc7807
rule reports propertiestype
andtitle
as missing when they are inherited usingallOf
.To Reproduce Steps to reproduce the behavior:
openapi.yaml
file:redocly lint
with ruleoperation-4xx-problem-details-rfc7807
enabledExpected behavior No error should be produced when using allOf if
type
andtitle
are present in the resulting schema.OpenAPI definition See above, using OpenAPI version 3.0.3
Redocly Version(s) 1.0.0-beta.112
Node.js
Version(s) Node v16Hope the information provided helps to narrow down the issue. Please let me know if I can provide any additional details. Thanks!