2.1.4 • Published 2 years ago

schema-org-json-schemas v2.1.4

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
2 years ago

Schema.org to JSON Schema

CircleCI

Generate JSON Schemas from Schema.org classes

You can find the generated schemas in the schemas/ directory.

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

Example

Schema.org class for a Book

PropertyExpected TypeDescription
abridgedBooleanIndicates whether the book is an abridged edition.
bookEditionTextThe edition of the book.
bookFormatBookFormatTypeThe format of the book.
illustratorPersonThe illustrator of the book.
isbnTextThe ISBN of the book.
numberOfPagesIntegerThe number of pages in the book.

Generated JSON Schema

{
  "$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

Credits

Thanks to geraintluff for the property multiplicity and the hardcoded schemas (licensed under the MIT License).

2.1.2

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago