We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
The schema path in the path argument of the mutation function is not escaped.
path
mutation
To Reproduce
traverse({ type: 'object', properties: { '.foo': { type: 'string' }, '.': { type: 'object', properties: { 'x': { type: 'number' } } }, '[foo]': { type: 'string', }, }, }, (schema, _isCycle, path) => { console.log(path) return schema })
"$.properties..foo" "$.properties...properties.x" "$.properties.." "$.properties.[foo]" "$"
Expected behavior
"$.properties['.foo']" "$.properties['.'].properties.x" "$.properties['.']" "$.properties['[foo]']" "$"
…or use JSON Pointer instead of JSON Path:
"/properties/.foo" "/properties/./properties/x" "/properties/." "/properties/[foo]"
…or just return an array of the path segments:
["properties", ".foo"] ["properties", ".", "properties", "x"] ["properties", "."] ["properties", "[foo]"]
JSON Path is not a good fit for this because it`s a query language, not an identifier, so it’s quite complex.
JSON Pointer is simpler and easier to work with. It has only two special characters: / which is escaped as ~1, and ~ which is escaped as ~0.
/
~1
~
~0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The schema path in the
path
argument of themutation
function is not escaped.To Reproduce
Expected behavior
…or use JSON Pointer instead of JSON Path:
…or just return an array of the path segments:
JSON Path is not a good fit for this because it`s a query language, not an identifier, so it’s quite complex.
JSON Pointer is simpler and easier to work with. It has only two special characters:
/
which is escaped as~1
, and~
which is escaped as~0
.The text was updated successfully, but these errors were encountered: