Summarising the other answers, here are the JSON schema generators proposed so far:
Online:
- https://www.liquid-technologies.com/online-json-to-schema-converter (1 input)
- http://www.jsonschema.net (1 input)
- https://easy-json-schema.github.io (1 input)
- https://json.ophir.dev/ (1 input, nice UI)
Python:
- https://github.com/gonvaled/jskemator (1 input but allows iteration)
- https://github.com/perenecabuto/json_schema_generator (1 input)
- https://github.com/rnd0101/json_schema_inferencer (1 input I think)
- https://pypi.python.org/pypi/genson/ (multiple inputs)
- https://pypi.python.org/pypi/skinfer (multiple inputs)
NodeJS:
- https://github.com/Nijikokun/generate-schema (multiple inputs (pass object array))
- https://github.com/easy-json-schema/easy-json-schema (1 input)
- https://github.com/aspecto-io/genson-js (multiple inputs)
Ruby:
- https://github.com/maxlinc/json-schema-generator (1 input)
PyPI
pypi.org › project › genson
genson · PyPI
GenSON is a powerful, user-friendly JSON Schema generator built in Python.
» pip install genson
Top answer 1 of 12
188
Summarising the other answers, here are the JSON schema generators proposed so far:
Online:
- https://www.liquid-technologies.com/online-json-to-schema-converter (1 input)
- http://www.jsonschema.net (1 input)
- https://easy-json-schema.github.io (1 input)
- https://json.ophir.dev/ (1 input, nice UI)
Python:
- https://github.com/gonvaled/jskemator (1 input but allows iteration)
- https://github.com/perenecabuto/json_schema_generator (1 input)
- https://github.com/rnd0101/json_schema_inferencer (1 input I think)
- https://pypi.python.org/pypi/genson/ (multiple inputs)
- https://pypi.python.org/pypi/skinfer (multiple inputs)
NodeJS:
- https://github.com/Nijikokun/generate-schema (multiple inputs (pass object array))
- https://github.com/easy-json-schema/easy-json-schema (1 input)
- https://github.com/aspecto-io/genson-js (multiple inputs)
Ruby:
- https://github.com/maxlinc/json-schema-generator (1 input)
2 of 12
101
You might be looking for this:
http://www.jsonschema.net
It is an online tool that can automatically generate JSON schema from JSON string. And you can edit the schema easily.
Videos
13:45
JSON Schema Validation in Python: Bring Structure Into JSON - YouTube
07:19
Generate Model schemas and JSON serialization in 20 languages with ...
01:31
Python - JSON file to Schema - YouTube
23:55
Pydantic 2 Crash Course | Python Data Validation, Serialization ...
01:55
Mastering the Art of Creating Python Classes from JSON Schema: ...
17:13
01 - Intro to JSON-schema validation in python and JavaScript || ...
jsonschema
python-jsonschema.readthedocs.io
jsonschema 4.26.0 documentation
PyPI version Supported Python versions Build status ReadTheDocs status pre-commit.ci status Zenodo DOI jsonschema is an implementation of the JSON Schema specification for Python. It can also be us...
GitHub
github.com › altair-viz › schemapi
GitHub - altair-viz/schemapi: Auto-generate Python APIs from JSON schema specifications
July 23, 2020 - JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. schemapi is a package that lets you auto-generate simple Python object-based APIs given a valid JSON schema specification.
Starred by 79 users
Forked by 12 users
Languages Python 82.4% | Jupyter Notebook 17.4% | Makefile 0.2% | Python 82.4% | Jupyter Notebook 17.4% | Makefile 0.2%
Unstructured
docs.unstructured.io › api-reference › partition › generate-schema
Generate a JSON schema for a file - Unstructured
You want to generate a schema for a JSON file that Unstructured produces, so that you can validate, test, and document related JSON files across your systems. Use a Python package such as genson to generate schemas for your JSON files.
PyPI
pypi.org › project › json-schema-codegen
json-schema-codegen · PyPI
This python library consumes JSON-Schema and generates C++ or Python code.
» pip install json-schema-codegen
JSON Schema
json-schema.org › learn › getting-started-step-by-step
Creating your first schema
This tutorial guides you through the process of creating a JSON Schema.
GitHub
github.com › Peter554 › dc_schema
GitHub - Peter554/dc_schema: Generate JSON schema from python dataclasses
Create a regular python dataclass and pass it to get_schema. import dataclasses import datetime import json from dc_schema import get_schema @dataclasses.dataclass class Book: title: str published: bool = False @dataclasses.dataclass class Author: ...
Starred by 22 users
Forked by 2 users
Languages Python 100.0% | Python 100.0%
GitHub
github.com › python-jsonschema › jsonschema
GitHub - python-jsonschema/jsonschema: An implementation of the JSON Schema specification for Python · GitHub
>>> from jsonschema import validate >>> # A sample schema, like what we'd get from json.load() >>> schema = { ... "type" : "object", ... "properties" : { ... "price" : {"type" : "number"}, ... "name" : {"type" : "string"}, ... }, ... } >>> # If no exception is raised by validate(), the instance is valid. >>> validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) >>> validate( ... instance={"name" : "Eggs", "price" : "Invalid"}, schema=schema, ...
Starred by 4.9K users
Forked by 611 users
Languages Python 99.8% | TypeScript 0.2%
GitHub
github.com › python-jsonschema › hypothesis-jsonschema
GitHub - python-jsonschema/hypothesis-jsonschema: Tools to generate test data from JSON schemata with Hypothesis · GitHub
Custom formats are ignored # by default, but you can pass custom strategies for them - e.g. custom_formats={"card": st.sampled_from(EXAMPLE_CARD_NUMBERS)}, ) ) def test_card_numbers(value): assert isinstance(value, str) assert re.match(r"^\d{4} \d{4} \d{4} \d{4}$", value) @given(from_schema({}, allow_x00=False, codec="utf-8").map(json.dumps)) def test_card_numbers(payload): assert isinstance(payload, str) assert "\0" not in payload # use allow_x00=False to exclude null characters # If you want to restrict generated strings characters which are valid in # a specific character encoding, you can do that with the `codec=` argument.
Starred by 279 users
Forked by 36 users
Languages Python
Horejsek
horejsek.github.io › python-fastjsonschema
Fast JSON schema for Python — fastjsonschema documentation
Support only for Python 3.3 and higher. fastjsonschema implements validation of JSON documents by JSON schema. The library implements JSON schema drafts 04, 06, and 07. The main purpose is to have a really fast implementation.
GitHub
github.com › perenecabuto › json_schema_generator
GitHub - perenecabuto/json_schema_generator: A simple json schema generator from any json source
Starred by 261 users
Forked by 71 users
Languages Python 100.0% | Python 100.0%
Pydantic
docs.pydantic.dev › latest › usage › json_schema
JSON Schema - Pydantic
April 3, 2023 - You're being redirected to a new destination
GitHub
github.com › cwacek › python-jsonschema-objects
GitHub - cwacek/python-jsonschema-objects: Automatic Python binding generation from JSON Schemas · GitHub
This avoids that problem by auto-generating classes, complete with validation, directly from an input JSON schema. These classes can seamlessly encode back and forth to JSON valid according to the schema. Literal values are wrapped when constructed to support validation and other schema-related operations. However, you can still use them just as you would other literals. >>> import python_jsonschema_objects as pjs >>> builder = pjs.ObjectBuilder(examples['Example Schema']) >>> ns = builder.build_classes() >>> Person = ns.ExampleSchema >>> james = Person(firstName="James", lastName="Bond") >>> str(james.lastName) 'Bond' >>> james.lastName += "ing" >>> str(james.lastName) 'Bonding' >>> james.age = 4 >>> james.age - 1 3 >>> 3 + james.age 7 >>> james.lastName / 4 Traceback (most recent call last): ...
Starred by 373 users
Forked by 90 users
Languages Python