﻿# JSON Pointer validation errors: field paths, missing properties and escaping

Represent nested validation locations without ambiguous dot paths, distinguish instance and schema locations, and preserve missing-field meaning across adapters.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-json-pointer-validation-error-location/
Language: en

## A path needs an explicit syntax

JSON Pointer identifies a value in a JSON document using a sequence of reference tokens. It is different from an informal dot-separated field name. Object keys can themselves contain punctuation that an informal path notation treats as structure.

For an inference request containing nested messages or tool definitions, an error must identify which item is affected. A proposed public error contract specifies the path syntax and the document to which it refers, including whether a gateway has transformed the submitted object before validation.

## Escaping preserves literal object keys

Pointer tokens escape a tilde and a slash using defined substitutions. A consumer cannot safely turn a pointer into object traversal merely by splitting the displayed string and treating every remaining character literally.

Keep path parsing separate from presentation. A field name containing a slash is one member name, not an extra nesting level. A UI may display a friendlier label, but its correction action should retain the original structured location rather than attempting to reconstruct it from translated prose.

## Instance and schema locations answer different questions

JSON Schema's output model distinguishes the location in the instance from the location of the evaluated schema keyword. One tells a consumer where the input is involved; the other explains which rule was applied.

For a required property that is absent, the instance location can point to the containing object while the failing keyword identifies the requirement. It should not falsely imply that a missing member can already be resolved as an existing value. Preserve the separate rule information when building a field-level explanation.

## Validator adapters can change path representation

Pydantic documents error locations as tuples containing field names and array indices, along with separate error types and messages. Converting those tuples into a dotted string is a presentation choice, not proof that the result has JSON Pointer semantics.

An adapter needs an explicit conversion for each location component. It also needs a policy for errors without a single correctable field. Joining components with punctuation can lose the distinction between a literal key and a nested path or between an object key and an array position.

## Correction refers to the submitted revision

A location is meaningful against a particular input structure. If a user inserts an earlier array item before applying a suggested correction, positional paths can refer to a different record. Associate the error with the request revision rather than assuming it remains valid indefinitely.

The proposed review checks escaped keys, nested arrays, missing properties and root-level errors. These cases reveal whether an API offers a usable correction address or only a plausible-looking message whose location cannot be applied reliably.

## Primary references

[JSON Pointer specification](https://www.rfc-editor.org/rfc/rfc6901.html).

[JSON Schema output locations](https://json-schema.org/draft/2020-12/json-schema-core).

[Pydantic validation error representation](https://pydantic.dev/docs/validation/latest/errors/errors/).

Related explanations: [Explicit operation idempotency](/journal/provider-post-retry-idempotency-ledger/); [Request correlation](/journal/provider-request-id-trace-context/).
