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

RequiredSyntaxChecker not validating duplicate array elements correctly for required properties array #301

Open
suryatej16 opened this issue Jun 7, 2019 · 0 comments

Comments

@suryatej16
Copy link

suryatej16 commented Jun 7, 2019

The validator has inconsistent behavior when validating duplicate elements in the required properties array. The following two schemas differ only by the order of elements in the required properties array, but one schema is validated successfully, while another fails validation:

Successful Schema

{
    "type": "object",
    "properties": {
        "name__c": {
            "label": "Passenger Name",
            "type": "string",
            "enum": [
                "test",
                "test",
                "noTest"
            ]
        },
        "dateOfBirth__c": {
            "label": "Date of Birth",
            "type": "string",
            "format": "date"
        }
    },
    "required": [
        "name__c",
        "name__c",
        "dateOfBirth__c"
    ]
}

Failed Schema

{
    "type": "object",
    "properties": {
        "name__c": {
            "label": "Passenger Name",
            "type": "string",
            "enum": [
                "test",
                "test",
                "noTest"
            ]
        },
        "dateOfBirth__c": {
            "label": "Date of Birth",
            "type": "string",
            "format": "date"
        }
    },
    "required": [
        "dateOfBirth__c",
        "name__c",
        "name__c"
    ]
}
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