Closed hudson-ai closed 1 month ago
Non-required properties that occur out-of-order are validated against additionalProperties, potentially leading to invalid objects.
additionalProperties
schema = { "type": "object", "properties": {"a": {"const": "foo"}, "b": {"const": "bar"}}, "required": ["b"], } test_string = '{"b": "bar", "a": "BAD"}' grammar = gen_json(schema=schema) assert grammar.match(test_string) is None # FAILS
Fixed by #1043
Non-required properties that occur out-of-order are validated against
additionalProperties
, potentially leading to invalid objects.