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

Doesn't support schemas with dashes/spaces in property names #198

Open
romancow opened this issue Aug 11, 2023 · 0 comments
Open

Doesn't support schemas with dashes/spaces in property names #198

romancow opened this issue Aug 11, 2023 · 0 comments

Comments

@romancow
Copy link

I'm getting a "Lexical error" when attempting to validate a schema with a property that has something like a space or dash in its name.

Here is a simple example schema, that will cause the error:
{"title":"Validation Test","type":"object","properties":{"Some-Prop": { "type": "string" }}}

import validator from "@json-schema-tools/validator"

const schema = {"title":"Validation Test","type":"object","properties":{"Some-Prop": { "type": "string" }}}

const validity = validator(schema,{})

wills result in this error:

Error: Lexical error on line 1. Unrecognized text.
$.Some-Prop
------^

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