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), andcontains
- Combining schema with
oneOf
,allOf
,anyOf
, andnot
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
Built Distribution
Hashes for json-schema-for-humans-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b0f42d3412079bb28bf21764edb7dae3e5dc482f26d00957decc55c6406566 |
|
MD5 | b5632fed97b221392348ab617c42051c |
|
BLAKE2b-256 | b3151d2478b8ab9cad54e71fbdd87af2a64f66b03b86149d63ed7935858d65ed |
Hashes for json_schema_for_humans-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 245ff5f4559ff1bcaeb7209cb4c5d7a695c6a2a00dca3b245813db593e998759 |
|
MD5 | ab745cd28c630714ad7e79e189026788 |
|
BLAKE2b-256 | 3f13a1abd3febd5ecb137935a7bb188bdeae24ef5ac0fadd1a123ac42128bc42 |