Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Const adds enum  #119

@TimSpeicher

Description

@TimSpeicher

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"
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions