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)
Answer from Steve Bennett on Stack Overflow
🌐
Pydantic
docs.pydantic.dev › latest › concepts › json_schema
JSON Schema - Pydantic Validation
The TypeAdapter class lets you create an object with methods for validating, serializing, and producing JSON schemas for arbitrary types. This serves as a complete replacement for schema_of in Pydantic V1 (which is now deprecated). Here's an example of generating JSON schema from a TypeAdapter:
🌐
PyPI
pypi.org › project › genson
genson · PyPI
GenSON is a powerful, user-friendly JSON Schema generator built in Python.
      » pip install genson
    
Published   May 15, 2024
Version   1.3.0
🌐
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...
🌐
Apidog
apidog.com › articles › how-to-create-json-schema-python
How to Create JSON Schema in Python
October 20, 2023 - Creating JSON schemas in Python is an essential skill for ensuring data quality and integrity in your applications. Python's "jsonschema" library simplifies the process of defining schemas and validating data against them.
🌐
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
    
Published   May 01, 2023
Version   0.6.3
Find elsewhere
🌐
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.
🌐
JSON Type Definition
jsontypedef.com › docs › python-codegen
Generating Python from JSON Typedef schemas
You can generate Python with jtd-codegen using the --python-out option, whose value must be a directory that jtd-codegen can generate code into. For example, if you have this schema in schemas/user.jtd.json:
🌐
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
🌐
DEV Community
dev.to › stefanalfbo › python-json-schema-3o7n
Python JSON schema - DEV Community
May 9, 2024 - JSON Schema can be a great tool to document this contract, define constraints and validate the contract. In Python we can use the jsonschema library to enable the power of JSON Schema in our projects.
🌐
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
A simple json schema generator from any json source - perenecabuto/json_schema_generator
Starred by 261 users
Forked by 71 users
Languages   Python 100.0% | Python 100.0%
🌐
Orchestra
getorchestra.io › guides › fastapi-and-json-schema-automatic-generation-from-models
FastAPI and JSON Schema: Automatic Generation from Models | Orchestra
March 20, 2024 - FastAPI provides a powerful and efficient way to automatically generate JSON Schemas from Python models. This feature is particularly useful for creating robust and well-documented APIs. In this tutorial, we'll delve into how FastAPI leverages Pydantic models to generate JSON Schemas and how you can utilize this for better API development.
🌐
Pydantic
docs.pydantic.dev › latest › usage › json_schema
JSON Schema - Pydantic
April 3, 2023 - You're being redirected to a new destination
🌐
Libraries.io
libraries.io › pypi › generate-json-schema
generate-json-schema 0.1.5 on PyPI - Libraries.io - security & maintenance data for open source software
July 26, 2023 - # Use the path of the directory already within your project from json_schema_converter.generate_schema import generate_json_schema schema = generate_json_schema("/pytests/schemas/teste.json")
🌐
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