Skip to content

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

@romancow

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

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