Skip to main content

Generate static HTML documentation from JSON schemas

Project description

JSON Schema for Humans

Quickly generate a beautiful HTML static page documenting a JSON schema

Installation

pip install json-schema-for-humans

Usage

generate-schema-doc [OPTIONS] SCHEMA_FILE RESULT_FILE

SCHEMA_FILE must be a valid JSON Schema

A CSS file will be copied in the same directory as RESULT_FILE

Options

--minify

On by default

Minify the output HTML document

--deprecated-from-description

Off by default

Mark a property as deprecated (with a big red badge) if the description contains the string [Deprecated

--default-from-description

Off by default

Extract the default value of a property from the description like this: [Default `the_default_value`]

The default value from the "default" attribute will be used in priority

What's supported

See the excellent Understanding JSON Schema to understand what are those checks

The following are supported:

  • Types
  • Regular expressions
  • Numeric types multiples and range
  • Constant and enumerated values
  • Required properties
  • Default values
  • Array minItems, maxItems, uniqueItems, items (schema that must apply to all of the array items), and contains
  • Combining schema with oneOf, allOf, anyOf, and not

These are not supported at the moment (PRs welcome!):

  • String length and format
  • Property names, size, and pattern
  • Array items at specific index (for example, first item must be a string and second must be an integer)
  • Property dependencies
  • Examples
  • Media
  • Conditional subschemas

References from inside a schema are supported (for example { $ref: "#/definitions/something" } will be replaced by the content of schema["definitions"]["something"])

References to schemas in other files are not supported for now.

Development

Testing

Just run tox

tox

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json-schema-for-humans-0.2.1.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

json_schema_for_humans-0.2.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file json-schema-for-humans-0.2.1.tar.gz.

File metadata

  • Download URL: json-schema-for-humans-0.2.1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for json-schema-for-humans-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b1dee1a0b053a21ca32c220ceb3573f1e6db90ee3e5c47e4723e302075d3d5d6
MD5 c18c52270c57b814e41fdea6b7f680a1
BLAKE2b-256 ef97f13611591813f762dbf7e40b92704ee7482d48a37f659c953bfdbfcd64d2

See more details on using hashes here.

File details

Details for the file json_schema_for_humans-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: json_schema_for_humans-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for json_schema_for_humans-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8759162630c8a59b9d2d72ffb09bb1b3c00f2f248797db84a8b43d1ec1abe9d4
MD5 f8964a4b0a2c703fc9c4dd3159e5fed3
BLAKE2b-256 d667dbb3c79d04ff476b71f707b4e0c0bc1415ceb0d890526cec5bec1108ff06

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page