{"record":{"id":"116e87cf84d272ed","repo":"ory/hydra","slug":"remote-json-pointers-are-not-supported-s","errorCode":null,"errorMessage":"remote JSON pointers are not supported: %s","messagePattern":"remote JSON pointers are not supported: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/jsonschemax/pointer.go","lineNumber":16,"sourceCode":"// Copyright © 2023 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\npackage jsonschemax\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n)\n\n// JSONPointerToDotNotation converts JSON Pointer \"#/foo/bar\" to dot-notation \"foo.bar\".\nfunc JSONPointerToDotNotation(pointer string) (string, error) {\n\tif !strings.HasPrefix(pointer, \"#/\") {\n\t\treturn pointer, errors.Errorf(\"remote JSON pointers are not supported: %s\", pointer)\n\t}\n\n\tvar path []string\n\tfor _, item := range strings.Split(strings.TrimPrefix(pointer, \"#/\"), \"/\") {\n\t\titem = strings.Replace(item, \"~1\", \"/\", -1)\n\t\titem = strings.Replace(item, \"~0\", \"~\", -1)\n\t\titem, err := url.PathUnescape(item)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tpath = append(path, strings.ReplaceAll(item, \".\", \"\\\\.\"))\n\t}\n\n\treturn strings.Join(path, \".\"), nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/jsonschemax/pointer.go#L1-L32","documentation":"JSONPointerToDotNotation only converts local JSON Pointers that start with the '#/' prefix (as used in error objects per RFC 6901 with the URI fragment form). If the pointer lacks the '#/' prefix — e.g., it is a bare pointer like '/foo/bar' or a remote absolute URI — the function rejects it rather than guessing. This keeps remote (network-resolving) pointers out of local dot-notation conversion.","triggerScenarios":"Calling jwks-independent helper jsonschemax.JSONPointerToDotNotation (called from FormatError) with an instancePath/location value that does not start with \"#/\", such as \"/components/schemas/Foo\" or \"https://example.com/schema#/foo\".","commonSituations":"Formatting schema validation errors where the validator emits RFC 6901 pointers without the '#' fragment prefix (many validators emit '/foo/bar', not '#/foo/bar'), or when error pointers point to external documents.","solutions":["Normalize the pointer before calling: prepend \"#\" if it starts with \"/\" (or \"#/\" handling as needed) so it is treated as a local fragment.","If the pointer is remote, resolve/trim it locally yourself and only pass the fragment part.","Handle the error by falling back to returning the raw pointer as the human-readable path.","Update the validator configuration to emit instance paths in '#/...' fragment form."],"exampleFix":"// before\npath, err := jsonschemax.JSONPointerToDotNotation(err.InstancePath) // \"/foo/bar\" -> error\n// after\nptr := err.InstancePath\nif strings.HasPrefix(ptr, \"/\") && !strings.HasPrefix(ptr, \"#\") {\n    ptr = \"#\" + ptr\n}\npath, err := jsonschemax.JSONPointerToDotNotation(ptr)","handlingStrategy":"validation","validationCode":"func normalizeJSONPointer(p string) string {\n    if !strings.HasPrefix(p, \"#/\") && strings.HasPrefix(p, \"/\") {\n        return \"#\" + p\n    }\n    return p\n}","typeGuard":"func isLocalJSONPointer(p string) bool { return strings.HasPrefix(p, \"#/\") }","tryCatchPattern":null,"preventionTips":["Normalize validator output to '#/...' fragment form before calling.","Strip remote URIs and pass only the local fragment.","Fall back to the raw pointer when conversion fails."],"tags":["json-pointer","validation","formatting"],"backgroundTag":"unsupported-json-pointer","analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}