Skip to content

Add support for JSON Schema const keyword validation#263

Open
XenosEleatikos wants to merge 1 commit into
thephpleague:masterfrom
XenosEleatikos:feature/add-const-keyword-validation
Open

Add support for JSON Schema const keyword validation#263
XenosEleatikos wants to merge 1 commit into
thephpleague:masterfrom
XenosEleatikos:feature/add-const-keyword-validation

Conversation

@XenosEleatikos

Copy link
Copy Markdown

This PR adds support for the 'const' keyword from JSON Schema Draft 6+. The const keyword allows specifying that a value must be exactly equal to a specific constant value.

Additionally, fixed nullableByType() to support type: "null" as string.
This ensures that schemas with type: "null" correctly allow null values,
which is required for const: null validation to work properly.

This PR adds support for the 'const' keyword from JSON Schema Draft 6+.
The const keyword allows specifying that a value must be exactly equal
to a specific constant value.

Additionally, fixed nullableByType() to support type: "null" as string.
This ensures that schemas with type: "null" correctly allow null values,
which is required for const: null validation to work properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant