# schema-org-json-schemas

> Generate JSON Schemas from Schema.org classes

Latest version **2.1.4** (published 2022-01-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install schema-org-json-schemas
pnpm add schema-org-json-schemas
yarn add schema-org-json-schemas
bun add schema-org-json-schemas
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.4 |
| Published | 2022-01-03 |
| First published | 2020-05-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Charles Tatibouët |
| Maintainers | charlestati |
| Keywords | schema.org, json schema |

## Links

- npm: https://www.npmjs.com/package/schema-org-json-schemas
- Repository: https://github.com/charlestati/schema-org-json-schema
- Homepage: https://github.com/charlestati/schema-org-json-schema#readme
- Issues: https://github.com/charlestati/schema-org-json-schema/issues
- npm.io page: https://npm.io/package/schema-org-json-schemas

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.1.4 (latest) — 2022-01-03
- 2.1.3 — 2022-01-03
- 2.1.2 — 2022-01-03
- 1.4.2 — 2020-05-28
- 1.4.1 — 2020-05-22
- 1.4.0 — 2020-05-22
- 1.3.0 — 2020-05-19
- 1.2.0 — 2020-05-13
- 1.1.1 — 2020-05-12
- 1.1.0 — 2020-05-11
- 1.0.0 — 2020-05-02

## README

# Schema.org to JSON Schema

[![CircleCI](https://circleci.com/gh/charlestati/schema-org-json-schemas.svg?style=svg)](https://circleci.com/gh/charlestati/schema-org-json-schemas)

**Generate JSON Schemas from Schema.org classes**

You can find the generated schemas in the [`schemas/` directory](schemas).

To match the JSON-LD approach, properties that accept an array also accept a single value.

## Example

### Schema.org class for a Book

| Property      | Expected Type  | Description                                        |
| ------------- | -------------- | -------------------------------------------------- |
| abridged      | Boolean        | Indicates whether the book is an abridged edition. |
| bookEdition   | Text           | The edition of the book.                           |
| bookFormat    | BookFormatType | The format of the book.                            |
| illustrator   | Person         | The illustrator of the book.                       |
| isbn          | Text           | The ISBN of the book.                              |
| numberOfPages | Integer        | The number of pages in the book.                   |

### Generated JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "schema:Book",
  "title": "Book",
  "description": "A book.",
  "type": "object",
  "allOf": [
    {
      "description": "The most generic kind of creative work, including books, movies, photographs, software programs, etc.",
      "$ref": "schema:CreativeWork"
    }
  ],
  "properties": {
    "abridged": {
      "description": "Indicates whether the book is an abridged edition.",
      "type": "boolean"
    },
    "bookEdition": {
      "description": "The edition of the book.",
      "type": "string"
    },
    "bookFormat": {
      "description": "The format of the book.",
      "$ref": "schema:BookFormatType"
    },
    "illustrator": {
      "description": "The illustrator of the book.",
      "$ref": "schema:Person"
    },
    "isbn": { "description": "The ISBN of the book.", "type": "string" },
    "numberOfPages": {
      "description": "The number of pages in the book.",
      "type": "integer"
    }
  }
}
```

## To do

- Hardcode the [identifiers schemas](https://schema.org/identifier) with [regular expressions](https://json-schema.org/understanding-json-schema/reference/regular_expressions.html)
- Hardcode the inferred property multiplicity after manually checking it

## Credits

Thanks to [geraintluff](https://github.com/geraintluff/schema-org-gen) for the property multiplicity and the hardcoded schemas (licensed under the [MIT License](https://opensource.org/licenses/MIT)).

---
_Source: https://npm.io/package/schema-org-json-schemas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
