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

Format assertions should be enabled for optional/ecmascript-regex.json #190

Open
justin-tay opened this issue Jun 12, 2024 · 3 comments · May be fixed by #191 or json-schema-org/JSON-Schema-Test-Suite#751
Assignees
Labels
bug Something isn't working

Comments

@justin-tay
Copy link
Contributor

Describe the bug
Format assertions should be enabled for optional/ecmascript-regex.json as the \\a is not an ECMA 262 control escape test is a format "format": "regex" that expects the result to be invalid.

    {
        "description": "\\a is not an ECMA 262 control escape",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "format": "regex"
        },
        "tests": [
            {
                "description": "when used as a pattern",
                "data": "\\a",
                "valid": false
            }
        ]
    }

https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/9fc880bfb6d8ccd093bc82431f17d13681ffae8e/tests/draft2020-12/optional/ecmascript-regex.json#L408-L421

Additional context
The current networknt json-schema-validator 1.4.0 doesn't pass the test but an upcoming version will.

@justin-tay justin-tay added the bug Something isn't working label Jun 12, 2024
@big-andy-coates
Copy link
Member

Thanks for letting me know @justin-tay . I'll take a look when I get time, or feel free to raise a PR.

@big-andy-coates
Copy link
Member

big-andy-coates commented Jun 22, 2024

Hey @justin-tay, I've raised json-schema-org/JSON-Schema-Test-Suite#751 to fix the issue at source.

Let's see what happens with that.

@justin-tay
Copy link
Contributor Author

There is a related discussion on this specific test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants