Skip to content

BUG: ECMA262 valid pattern throws an exception #413

Open
@jeremyfiel

Description

@jeremyfiel

I have a valid ECMA262 pattern defined but the application is throwing an exception.

com.github.fge.jsonschema.core.exceptions.InvalidSchemaException: fatal: invalid JSON Schema, cannot continue     
    Syntax errors:
[{
    "level": "error",
    "message": "string \"((?<OrgOID>[^,. ]+)\\s*\\.\\s*(?<AOID>[^,. ]+))(?:\\s*,\\s*)?\" is not a valid ECMA 262 regular expression",
    "domain": "syntax",
    "schema": {
        "loadingURI": "#",
        "pointer": ""
    },
    "keyword": "pattern",
    "value": "((?<OrgOID>[^,. ]+)\\s*\\.\\s*(?<AOID>[^,. ]+))(?:\\s*,\\s*)?"
}]
level: "fatal"
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "string",
  "pattern": "((?<OrgOID>[^,. ]+)\\s*\\.\\s*(?<AOID>[^,. ]+))(?:\\s*,\\s*)?"
}

valid instance

FFFF.12645,AAAA.6456

I'm guessing it has something to do with the escaping pattern but that is valid per the specification and I can't modify it from my JSON Schema schema otherwise it will break other tooling.

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