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
Request can only accept id
ExtendedRequest can only accept id AND extra_id
It is now not checked by the validator, so I can send extra parameters like 'extra_parameter' and it's still valid.
If I use additionalProperties: false, it will read Request first, and then it will immediately give error extra_id is not allowed
This is maybe because 3.1 is not fully supported yet? Because Attribute/Annotations should also support it then
If I use additionalProperties instead I get this
Keyword validation failed: Data has additional properties (extra_id) which are not allowed Field
And as I read it, this is not supported by additionalProperties, but is supported by unevaluatedProperties
The only solution is to 'unroll' the properties into ExtendedRequest, so no inheritance takes place and I can use additionalProperties. Maybe the code could support generating it like that? That would also solve my issue for now. So not reffing but copying the properties.
The text was updated successfully, but these errors were encountered:
minardus
changed the title
Support unevaluatedProperties
Support unevaluatedProperties OpenAPI 3.1
Nov 29, 2023
Have you tried and verified that unevaluatedProperties is supported by tools like swagger-ui? Just asking as I do not have time to track things at that level.
unevaluatedProperties is in 3.1 spec, it is the same as additionalProperties, but it can see through $refs.
Example:
Request can only accept id
ExtendedRequest can only accept id AND extra_id
It is now not checked by the validator, so I can send extra parameters like 'extra_parameter' and it's still valid.
If I use additionalProperties: false, it will read Request first, and then it will immediately give error extra_id is not allowed
This is maybe because 3.1 is not fully supported yet? Because Attribute/Annotations should also support it then
If I use additionalProperties instead I get this
Keyword validation failed: Data has additional properties (extra_id) which are not allowed Field
And as I read it, this is not supported by additionalProperties, but is supported by unevaluatedProperties
https://json-schema.org/understanding-json-schema/reference/object#unevaluated-properties
Also the problem is described here
json-schema-org/json-schema-spec#661
The only solution is to 'unroll' the properties into ExtendedRequest, so no inheritance takes place and I can use additionalProperties. Maybe the code could support generating it like that? That would also solve my issue for now. So not reffing but copying the properties.
The text was updated successfully, but these errors were encountered: