Skip to content

feat: support const tag#125

Open
abemedia wants to merge 1 commit intoinvopop:mainfrom
abemedia:feat/const-tag
Open

feat: support const tag#125
abemedia wants to merge 1 commit intoinvopop:mainfrom
abemedia:feat/const-tag

Conversation

@abemedia
Copy link
Copy Markdown
Contributor

@abemedia abemedia commented Jan 8, 2024

Support setting const using tag i.e. jsonschema:"const=foo".

Copy link
Copy Markdown
Contributor

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite sure why this would be needed, but seems simple enough! Would it be possible to create a new test example instead of modifying the main example structures so there are less changes? Thanks!

@bflad
Copy link
Copy Markdown

bflad commented Jan 29, 2025

We have a use case for this currently -- a const: "1.0.0" on a future-proofing version number field. It'll get swapped to validation constraints if/when additional version numbers are supported in the field, but for now there is only one supported value, hence the const usage.

@abemedia any chance you might be able to address the requested changes? Thanks for putting this together!

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.

3 participants