Skip to content

json_schema: Allow const/enum to contain arrays and objects #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Zantier
Copy link

@Zantier Zantier commented Apr 9, 2025

When parsing a JSON schema file, the value of ["const"] and ["enum" array elements] can be arrays and objects.

Note that the values are literals, so objects are not treated as sub-schemas. From the JSON Schema specification:
https://json-schema.org/draft/2020-12/json-schema-validation#name-const

An instance validates successfully against this keyword if its value is equal to the value of the keyword.

Need to allow for whitespace
@Zantier Zantier changed the title json_schema: Allow enums to contain arrays and objects json_schema: Allow const/enum to contain arrays and objects Apr 10, 2025
@Zantier Zantier marked this pull request as ready for review April 10, 2025 21:34
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