Skip to content

romain325/json-schema.org

Repository files navigation

Schema.org JSON Schema Generator

Transform schema.org vocabulary into JSON Schema (Draft 2020-12) format.

Features

  • All 1,435+ schema.org types
  • Includes catalog.json for IDE integration (SchemaStore.org format)
  • Uses allOf to maintain type hierarchy
  • Works seamlessly with OpenAPI specifications
  • Supports both single values and arrays (matching schema.org semantics)
  • All schemas validated against JSON Schema Draft 2020-12 meta-schema

Quick Start

Use Hosted Schemas

The latest schemas are automatically deployed to GitHub Pages:

# Reference schemas directly from GitHub Pages
https://romain325.github.io/json-schema.org/Person.json
https://romain325.github.io/json-schema.org/Organization.json
https://romain325.github.io/json-schema.org/catalog.json

Dev

See SETUP

Configuration

Customize generation by editing config/default-config.yaml:

output:
  directory: "output/schemas"

filtering:
  exclude_deprecated: true # Skip superseded types
  exclude_pending: false # Include pending types

transformation:
  flexible_arrays: true # Allow single or array values
  json_schema_version: "2020-12"
  add_examples: false

metadata:
  strip_html: true # Remove HTML tags from descriptions
  preserve_comments: true # Include schema.org comments

Contributing

Contributions welcome! Please:

  1. Open an issue
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass: mise run test
  5. Format code: mise run format
  6. Submit a pull request

License

MIT License - see LICENSE for details.

Related Projects