java-json-tools/json-schema-validator

BUG: ECMA262 valid pattern throws an exception

Opened this issue · 0 comments

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.