Skip to content

Concepts

This section explains the design behind pydantic-jsonpointer. Read these pages to understand why the library is structured the way it is before diving into the reference.

  • JsonPointer type

    A str subclass with parsed-token storage, RFC 6901 validation in __new__, escape/unescape helpers, and full Pydantic v2 schema integration.

  • Model-based pointers

    Building JsonPointer strings from Pydantic model attribute chains with pointer_from_model(), including Union disambiguation and RootModel entry.

  • Traversal

    Ptr handles, resolve() semantics, the four convenience helpers, frozen taint propagation, and the Ellipsis sentinel.

  • Adapters

    The ContainerAdapter protocol, the eight required methods plus the optional is_value_frozen hook, and the module-level registry.

  • Field resolvers

    The three shipped policies — ByAttribute, BySerializationAlias, ByValidationAlias — and when to pick each.

  • Errors

    The six-class exception hierarchy with intentional multiple inheritance so callers can catch under stdlib exception types.