Toolvito

Calculates on this device. File exports run online.

Data Schema Generator & Validator

Paste sample JSON (or YAML) and get the JSON Schema it follows: types, required properties, formats such as dates and e-mail addresses, and lists. Check data against a schema with every problem and its place, make example or test data from a schema, or write the schema for Avro, OpenAPI, BigQuery, MongoDB, SQL, protobuf or TypeScript.

Enter your values

Paste one or more examples of your data. The page works out the schema they share: the type of each property, which ones every example has (required), formats such as dates and e-mail addresses, and lists.

Your values

One or more examples of the data the schema is for.

More options

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

XML Schema (XSD) and large files on the server

Task
XML Schema (XSD) to and from JSON Schema, XSD from XML, and one schema from many files

Choose the files for what you want: an .xsd file (or a ZIP with the .xsd files that include each other) to make a JSON Schema or an example XML; sample XML files to make an XSD; a JSON Schema file to make an XSD; or JSON, JSON Lines or YAML files to make one JSON Schema for all of them. Each result is checked on the server before it is returned.

Or drop files here. XSD, ZIP, XML, JSON, JSONL, NDJSON, YAML or YML, up to 50 files, 50 MB each at most.

    More options

    For an XSD with several global elements; for JSON Schema to XSD, the name of the root element (the schema title when empty).

    The .xsd file that includes the others, when the ZIP holds several.

    The calculator above works on your device. When you run a task in this section, Toolvito receives the values and result you submit to make the file or run the check. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

    How to make a JSON Schema from JSON

    1. Choose Make a schema from sample data and paste one or more examples of your data, or open a JSON, JSON Lines or YAML file.
    2. Say how the samples are written: one document, each item of a list, one document on each line (JSON Lines), or YAML.
    3. Choose the JSON Schema version (Draft 2020-12 is the newest; Draft 7 is still the most widely used) and press Make the schema.
    4. Copy or download the schema. The table lists each property with its type and whether every sample has it (required).

    Check data against a schema

    Choose Check data against a schema, paste the schema and the data. Every problem is listed with its place in the data as a JSON pointer (such as /items/2/price), the rule (type, required, enum, pattern, minimum …) and what is wrong. The schema can be JSON Schema (Draft 4, 6, 7, 2019-09 or 2020-12, in JSON or YAML), an OpenAPI 3 or Swagger 2 document, an Avro schema, TypeScript interfaces or SQL CREATE TABLE statements. Data can be JSON, a list of documents, JSON Lines or YAML.

    Make example and test data

    Choose Make example data from a schema. With one record the page writes a fixed example that uses the examples, defaults and allowed values of the schema; with more it makes up records from a seed (the same seed gives the same records). Every record is checked against the schema again, and records that cannot meet a rule (a pattern, for example) are counted and named.

    Convert a schema

    • JSON Schema → TypeScript, Avro, OpenAPI 3.0 or 3.1, BigQuery, MongoDB ($jsonSchema validator), SQL CREATE TABLE (PostgreSQL, MySQL, SQLite, SQL Server), Protocol Buffers (proto3) and Markdown documentation.
    • OpenAPI or Swagger, Avro, TypeScript interfaces and SQL CREATE TABLE → JSON Schema.
    • What the other language cannot say (a pattern in Avro, oneOf in BigQuery …) is listed under the result: nothing is dropped without a word.
    • XML Schema (XSD) to and from JSON Schema, an XSD made from sample XML, and an example XML from an XSD are made on the server: use the box below.

    Limits you should know

    • A schema made from samples can only describe what the samples show: add samples with every optional property, and check the required list.
    • References ($ref) are followed inside the schema only; a schema on another web address is not fetched.
    • Numbers are JavaScript numbers in the page: whole numbers longer than 15 digits lose digits. The server check (box below) reads them exactly.
    • Formats checked in the page: date-time, date, time, email, hostname, ipv4, ipv6, uri, uuid, regex and json-pointer. Others are listed as not checked.
    • Classes in Java, C# or Python are not read; TypeScript interfaces are.

    Privacy

    Schemas and data are read, checked and converted in your browser. Only what you send with a box below goes to the Toolvito server: the files you choose there, and for a check of many files the schema shown above. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

    Related tools