ory/hydra · error

remote JSON pointers are not supported: %s

Error message

remote JSON pointers are not supported: %s

What it means

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.

Source

Thrown at oryx/jsonschemax/pointer.go:16

// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package jsonschemax

import (
	"net/url"
	"strings"

	"github.com/pkg/errors"
)

// JSONPointerToDotNotation converts JSON Pointer "#/foo/bar" to dot-notation "foo.bar".
func JSONPointerToDotNotation(pointer string) (string, error) {
	if !strings.HasPrefix(pointer, "#/") {
		return pointer, errors.Errorf("remote JSON pointers are not supported: %s", pointer)
	}

	var path []string
	for _, item := range strings.Split(strings.TrimPrefix(pointer, "#/"), "/") {
		item = strings.Replace(item, "~1", "/", -1)
		item = strings.Replace(item, "~0", "~", -1)
		item, err := url.PathUnescape(item)
		if err != nil {
			return "", err
		}
		path = append(path, strings.ReplaceAll(item, ".", "\\."))
	}

	return strings.Join(path, "."), nil
}

View on GitHub (pinned to 4174065ffb)

Solutions

  1. Normalize the pointer before calling: prepend "#" if it starts with "/" (or "#/" handling as needed) so it is treated as a local fragment.
  2. If the pointer is remote, resolve/trim it locally yourself and only pass the fragment part.
  3. Handle the error by falling back to returning the raw pointer as the human-readable path.
  4. Update the validator configuration to emit instance paths in '#/...' fragment form.

Example fix

// before
path, err := jsonschemax.JSONPointerToDotNotation(err.InstancePath) // "/foo/bar" -> error
// after
ptr := err.InstancePath
if strings.HasPrefix(ptr, "/") && !strings.HasPrefix(ptr, "#") {
    ptr = "#" + ptr
}
path, err := jsonschemax.JSONPointerToDotNotation(ptr)
Defensive patterns

Strategy: validation

Validate before calling

func normalizeJSONPointer(p string) string {
    if !strings.HasPrefix(p, "#/") && strings.HasPrefix(p, "/") {
        return "#" + p
    }
    return p
}

Type guard

func isLocalJSONPointer(p string) bool { return strings.HasPrefix(p, "#/") }

Prevention

When it happens

Trigger: 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".

Common situations: 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.

Related errors


AI-assisted analysis of ory/hydra@4174065ffb (2026-09-03). Data as JSON: /api/errors/116e87cf84d272ed. Report an issue: GitHub.