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
In my schema I use reference and schema is validated. But it should not, because it refer to wrong resource type: schemas but should refer to parameter
In my validator implementation I may hardcode this check: after ref resolution it should refer to parameter.
Is there a way to provide some hints to validator about type for referenced object?
Here $type will provide hint that after resolution the schema should be validated against "#/definitions/parameter" schema. Would it be useful to provide such hints?
The text was updated successfully, but these errors were encountered:
JSON Schema does not have a feature for validating the $ref target.
There is a proposal for such a feature at json-schema-org/json-schema-spec#141 but it's somewhat controversial and unlikely to be considered before draft-09 (the JSON Schema project is currently working on draft-08, and OpenAPI is using draft-04).
Since OAS 3.1 is adopting the most recent JSON Schema draft, and this more of a JSON Schema thing, I think this is better tracked at json-schema-org/json-schema-spec#141
Additionally, the question of requiring (rather than validating) that $refs point to #/components/ is tracked at #2084
I am trying to implement openapi validator. I am using Tim Burks schema
In my schema I have next definition:
OpenAPI schema defines that
paramters
maybe parameter definition or referenceIn my schema I use reference and schema is validated. But it should not, because it refer to wrong resource type:
schemas
but should refer toparameter
In my validator implementation I may hardcode this check: after ref resolution it should refer to parameter.
Is there a way to provide some hints to validator about type for referenced object?
Here $type will provide hint that after resolution the schema should be validated against
"#/definitions/parameter"
schema. Would it be useful to provide such hints?The text was updated successfully, but these errors were encountered: