Skip to content
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

Const adds enum #119

Open
TimSpeicher opened this issue Aug 9, 2024 · 0 comments
Open

Const adds enum #119

TimSpeicher opened this issue Aug 9, 2024 · 0 comments

Comments

@TimSpeicher
Copy link

Is there a particular reason when giving JSF a schema with a const value it adds an enum of this const value to the schema?
It does not create any problems but looks weird.

{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "test": {
            "type": "number",
            "const": 2
        }
    },
    "required": [
        "test"
    ]
}

resulting in after constructor call:

{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "test": {
            "type": "number",
            "const": 2,
            "enum": [
                2
            ]
        }
    },
    "required": [
        "test"
    ]
}
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

No branches or pull requests

1 participant