You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found an issue with object composition where swagger-spec-validator works one way and openapi-spec-validator (--schema 2.0) works a different way, and I'm not entirely sure which one is "wrong".
it validates fine in swagger-spec-validator but openapi-spec-validator complains that it cannot find the required field 'name'.
If I change the definition of NameRequiredObject to:
NameRequiredObject:
allOf:
- $ref: '#/definitions/NameObject'
- properties:
id:
minLength: 1
type: string
type: object
required:
- id
- name
so that required is now part of the allOf object composition, swagger-spec-validator fails because it cannot find the name field, but openapi-spec-validator passes.
It's not clear from the Swagger2.0 spec whether the required attribute should be a property of the NameRequiredObject, or if it should be included in the allOf object composition, and clearly the two projects have implemented it differently.
I'm looking for a reference that will "decide" which format is "correct", and thus which tool is "correct". so my specs will pass validation by both tools.
Thanks,
Bob
The text was updated successfully, but these errors were encountered:
I have found an issue with object composition where swagger-spec-validator works one way and openapi-spec-validator (--schema 2.0) works a different way, and I'm not entirely sure which one is "wrong".
If I compose an object like this:
it validates fine in swagger-spec-validator but openapi-spec-validator complains that it cannot find the required field 'name'.
If I change the definition of NameRequiredObject to:
so that required is now part of the allOf object composition, swagger-spec-validator fails because it cannot find the name field, but openapi-spec-validator passes.
It's not clear from the Swagger2.0 spec whether the required attribute should be a property of the NameRequiredObject, or if it should be included in the allOf object composition, and clearly the two projects have implemented it differently.
I'm looking for a reference that will "decide" which format is "correct", and thus which tool is "correct". so my specs will pass validation by both tools.
Thanks,
Bob
The text was updated successfully, but these errors were encountered: