Skip to content

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

Description

@romancow

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
------^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions