referencing

Implementation-agnostic JSON reference resolution for JSON Schema, OpenAPI, and beyond

Library
PyPI
v0.37.0
54stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
78/100Good
Development Activity96
Maintenance100
Community44
Maturity52
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture85
Code Quality88
Innovation72
Learning Curve68

referencing is a small, implementation-agnostic Python library for resolving $ref/JSON reference-style pointers across specifications — JSON Schema, OpenAPI, AsyncAPI, or any custom hypermedia format that uses the same referencing pattern. It grew out of the jsonschema project as a standalone, spec-agnostic replacement for ad hoc reference-resolution code, providing an explicit Registry and Resource model for tracking which documents are known, how they relate, and how a reference should be dereferenced within that registry.

Because reference resolution semantics differ subtly between specifications (JSON Schema’s own dialects handle $id/$anchor/$ref differently across draft versions, for example), referencing models this as pluggable “specifications” rather than hardcoding one behavior — the referencing.jsonschema module supplies JSON Schema-specific specs for each draft, while the core referencing package stays specification-neutral. It has become foundational infrastructure: it’s a direct dependency of jsonschema itself and is pulled in, often transitively, by huge swaths of the Python ecosystem that validate JSON Schema or OpenAPI documents.

What You Get

  • A Registry for tracking resources and resolving references across documents without global mutable state
  • Pluggable Specification objects that encode format-specific referencing rules (e.g. per-draft JSON Schema semantics)
  • Built-in JSON Schema draft support (Draft 4 through the latest) via referencing.jsonschema
  • A retrieval hook for lazily fetching external references (e.g. over the network or from a local store)
  • Conformance against the shared json-schema-org test suite via a bundled test corpus

Common Use Cases

  • Resolving $ref pointers when validating JSON Schema documents across mixed draft versions
  • Building an OpenAPI or AsyncAPI tool that needs correct, spec-aware reference resolution
  • Implementing a custom hypermedia or config format that uses JSON-reference-style pointers
  • Replacing ad hoc, hand-rolled $ref resolution code with a tested, spec-agnostic library

Under The Hood

Architecture - The core model lives in referencing/_core.py (~730 lines): a Registry is an immutable-by-convention mapping of URIs to Resource objects, and resolving a reference walks that registry via a Resolver that is scoped to the current document, correctly handling nested $id/base-URI changes. referencing/jsonschema.py (~640 lines) supplies Specification instances for each JSON Schema draft, encoding how $ref, $anchor, and $dynamicRef behave differently release to release, while referencing/retrieval.py provides an extension point for fetching not-yet-known external resources on demand.

Tech Stack - Modern, minimal-dependency Python (targeting 3.13+ classifiers) built with hatchling/hatch-vcs, using attrs internally (referencing/_attrs.py) for its core data classes, and managed with uv for dependency locking and nox for task automation.

Code Quality - referencing/tests/ contains dedicated suites for core resolution logic, JSON Schema-specific behavior, the retrieval hook, and exception handling, plus test_referencing_suite.py, which runs the library against the shared, cross-implementation json-schema-org test suite (suite/ submodule) — meaning correctness is validated against the same conformance tests other JSON Schema implementations use, not just hand-written unit tests.

API Design - The public surface is deliberately small: construct a Registry, add Resources, and call .resolver()/.resolve(); because the library models referencing as immutable value objects rather than mutable global state, integrating it requires understanding its registry/resource vocabulary upfront, which is a small but real learning curve for a library whose job is otherwise conceptually simple.

Used by 6 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
79%
Apache 2.0

changedetection.io

Monitoring

33,241

Self-hosted website change detection with AI-powered smart alerts, browser automation, price tracking, and 85+ notification channels.

View details
90
Repo Health
80
Technical
69
Dependency
Built with
Python79%
Updated 3 days ago
Python
100%
Apache 2.0

ClearML

Devops · Automation

6,827

Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.

View details
94
Repo Health
79
Technical
69
Dependency
Built with
Python100%
Updated yesterday
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
TypeScript
97%
Other

GrowthBook

Developer Tools · Analytics · Monitoring

8,138

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript97%
Updated today
Python
94%
Apache 2.0

SWIRL

Search · Databases · Data Engineering

3,039

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
77
Repo Health
83
Technical
65
Dependency
Built with
Python94%
Updated 2 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search