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
When no field is required. This is not accepted by those libraries.
Ideally I would have been creating pull requests against those libraries (and I will be, when time permits), but I think leaving an empty required field is "bug". I mean it is allowed by latest specs:
The value of this keyword MUST be an array. Elements of this array,
if any, MUST be strings, and MUST be unique.
An object instance is valid against this keyword if every item in the
array is the name of a property in the instance.
Omitting this keyword has the same behavior as an empty array.
I think it would be pragmatic to drop the required field if it is empty. We should accept it in input, but drop it in output. But that breaks idempotency across the roundtrip.
So, what do you think?
The text was updated successfully, but these errors were encountered:
Seems a valid reason to drop idempotency in the round trip. We can alter the test a bit to compare 'simplified' versions of the schema, 'simplified' meaning we remove empty required arrays if they exist.
I am using golang:gojsonschema and python:jsonschema. They both only support v4 of the json-schema.
V4 required field says:
We are currently generating schema like this:
When no field is required. This is not accepted by those libraries.
Ideally I would have been creating pull requests against those libraries (and I will be, when time permits), but I think leaving an empty
required
field is "bug". I mean it is allowed by latest specs:I think it would be pragmatic to drop the
required
field if it is empty. We should accept it in input, but drop it in output. But that breaks idempotency across the roundtrip.So, what do you think?
The text was updated successfully, but these errors were encountered: