Browse the schemas at https://schemas.sourcemeta.com/sourcemeta/std
Building professional OpenAPI specifications demands precision, but mastering JSON Schema is hard. This library eliminates that burden by providing production-ready schemas that encode industry standards and best practices. Reference them directly in your API specifications and focus on what matters: designing great APIs.
Led and maintained by a member of the JSON Schema Technical Steering Committee
Use this library to:
- Build production-grade OpenAPI specifications without writing schemas from scratch
- Skip the JSON Schema learning curve while maintaining expert-level quality
- Meet compliance and regulatory requirements with standards-based validation
- Establish a solid foundation for your organisation's API governance program
Warning
This project is in its early stages with much more to come. We need your feedback to shape its future. Please share your thoughts and suggestions on what you would like to see.
Note
All schemas target JSON Schema 2020-12, the dialect used by OpenAPI v3.1 and later. Earlier JSON Schema dialects will be supported in the future.
This library provides schemas that encode aspects of the following standards. Note that these standards often contain concepts and specifications that cannot be represented as schemas. We extract and formalize the portions that can be expressed as JSON Schema definitions.
| Organisation | Standard | Title |
|---|---|---|
| IEEE | IEEE Std 754-2019 | IEEE Standard for Floating-Point Arithmetic |
| IEEE | IEEE Std 1003.1-2017 | IEEE Standard for Information TechnologyβPortable Operating System Interface (POSIX) Base Specifications, Issue 7 |
| IETF | RFC 3066 | Tags for the Identification of Languages |
| IETF | RFC 3986 | Uniform Resource Identifier (URI): Generic Syntax |
| IETF | RFC 4648 | The Base16, Base32, and Base64 Data Encodings |
| IETF | RFC 4918 | HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV) |
| IETF | RFC 5322 | Internet Message Format |
| IETF | RFC 5646 | Tags for Identifying Languages (BCP 47) |
| IETF | RFC 5789 | PATCH Method for HTTP |
| IETF | RFC 6901 | JavaScript Object Notation (JSON) Pointer |
| IETF | RFC 7807 | Problem Details for HTTP APIs |
| IETF | RFC 8141 | Uniform Resource Names (URNs) |
| IETF | RFC 9110 | HTTP Semantics |
| ISO | ISO 3166-1:2020 | Codes for the representation of names of countries and their subdivisions β Part 1: Country codes |
| ISO | ISO 4217:2015 | Codes for the representation of currencies and funds |
| ISO | ISO 639:2023 | Codes for the representation of names of languages |
| ISO | ISO 8601-1:2019 | Date and time β Representations for information interchange β Part 1: Basic rules |
| ISO | ISO 8601-2:2019 | Date and time β Representations for information interchange β Part 2: Extensions |
| ISO | ISO 80000-1:2022 | Quantities and units β Part 1: General |
| ISO/IEC | ISO/IEC 2382:2015 | Information technology β Vocabulary |
| ISO/IEC | ISO/IEC 9899:2024 | Programming languages β C |
| JSON-RPC | JSON-RPC 2.0 | JSON-RPC 2.0 Specification |
| JSON Schema | Draft 2020-12 | JSON Schema: A Media Type for Describing JSON Documents |
| W3C | XML Schema Part 2 | XML Schema Datatypes Second Edition |
To request coverage of another standard, please open an issue on GitHub.
While you can always copy-paste schemas directly, here are more convenient and maintainable ways to consume them.
We periodically publish the JSON Schema standard library to Sourcemeta
Schemas, our free service for
hosting open-source schemas. Each schema gets a unique HTTPS URL that you can
directly reference from your OpenAPI specifications using the
$ref keyword. For
example:
schema:
type: object
properties:
email:
$ref: 'https://schemas.sourcemeta.com/sourcemeta/std/<version>/ietf/email/address'To de-reference and embed these external URLs when distributing your OpenAPI
specification, use standard tools like redocly bundle.
We publish archives of the JSON Schema standard library to GitHub
Releases. Download and extract an
archive to your preferred location, then reference the JSON files from your
OpenAPI specifications using the
$ref keyword with a
relative path. For example:
schema:
type: object
properties:
email:
$ref: "../path/to/sourcemeta-std/ietf/email/address.json"If your OpenAPI specification lives in a Git repository, you can add this library as a git submodule. This approach keeps the schemas versioned alongside your code and ensures consistent access across your team. Add the submodule to your repository:
git submodule add https://github.com/sourcemeta/std stdThen reference the schemas using the
$ref keyword with a
relative path. For example:
schema:
type: object
properties:
email:
$ref: './std/schemas/ietf/email/address.json'Vendorpull is our tool for
vendoring Git repositories, which we use across our projects. It provides an
easier alternative to submodules by committing upstream contents directly into
your repository while letting you easily manage and update them. Add this line
to your DEPENDENCIES file:
std https://github.com/sourcemeta/std v<x.y.z>
Then pull the library into your vendor directory:
./vendor/vendorpull/pull stdReference the schemas using the
$ref keyword with a
relative path. For example:
schema:
type: object
properties:
email:
$ref: './vendor/std/schemas/ietf/email/address.json'While the project is publicly available on GitHub, it operates under a source-available license rather than a traditional open-source model. You may freely use these schemas for non-commercial purposes, but commercial use requires a paid commercial license.
We are happy to discuss OEM and white-label distribution options for incorporating these schemas into commercial products.
We welcome contributions! By sending a pull request, you agree to our contributing guidelines. Meaningful contributions to this repository can be taken into consideration towards a discounted (or even free) commercial license.
Tip
Do you want to level up your JSON Schema skills? Check out learnjsonschema.com, our growing JSON Schema documentation website, our JSON Schema for OpenAPI video course, and our O'Reilly book Unifying Business, Data, and Code: Designing Data Products with JSON Schema.
If you have any questions or comments, don't hesitate in opening a ticket on GitHub Discussions or writing to us at [email protected].