membrane-php / membrane-core

Membrane is a general purpose input validation library, supports both PHP Attributes and OpenAPI specifications
Other
1 stars 2 forks source link

Support "unevaluatedProperties" #122

Open charjr opened 1 year ago

charjr commented 1 year ago

unevaluatedProperties is a bit like additionalProperties but it checks against all subSchemas and adjacent schemas.

i.e.

allOf:
  - properties:
    - foo
    - bar
    additionalProperties: false
  - properties:
    - baz
    required:
      - baz

The above will always fail because the second schema requires baz, but the first schema would consider baz to be an additionalProperty.

allOf:
  - properties:
    - foo
    - bar
    unevaluatedProperties: false
  - properties:
    - baz
    required:
      - baz

The above is able to pass, because the second schema evaluates baz.

See the following for more information: https://json-schema.org/understanding-json-schema/reference/object.html#unevaluated-properties

https://github.com/json-schema-org/json-schema-spec/issues/556