Handle url encoded $ref pointers in subschema expansion#1684
Handle url encoded $ref pointers in subschema expansion#1684kyum1n wants to merge 1 commit intojson-editor:masterfrom
Conversation
a4db091 to
a00cd2b
Compare
|
I think those errors on the firefox jobs do not seem to be caused by my changes. Build and Test / end-to-end-test (firefox, build.prod) (pull_request) seems like it went through and failed somewhere in the "after all" hook? Build and Test / end-to-end-test (firefox, build.nonmin.travis) (pull_request) has two failed tests: The corresponding chrome jobs finished without errors. I would appreciate any feedback how to move this further. |
Fixes a bug where $refs with percent-encoding were not resolved and resulted in no validation (always passing) and no editor restrictions (can select anything).
Seems like it was already fixed a while ago in the original repo (jdorn/json-editor#402).
As far as I could trace it back, last it worked was in 2.6.1 and broke in 2.7.0 with 615de2d likely being the cause where the path segments were not uri decoded.
In our specific case, we built a schema using ts-json-schema-generator with generics:
which then generated the following schema:
{ "$ref": "#/definitions/Foo", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Bar<string>": { "additionalProperties": false, "properties": { "bar": { "type": "string" } }, "required": [ "bar" ], "type": "object" }, "Foo": { "additionalProperties": false, "properties": { "foo": { "$ref": "#/definitions/Bar%3Cstring%3E" } }, "required": [ "foo" ], "type": "object" } } }and resulted in observing this bug.
As far as I can tell, this should be backward-compatible and I also added a minimal test case using <> in a defintion name.