Sphinx extension to display JSON Schema
Project description
This package contains sphinx-jsonschema, an extension to Sphinx to allow authors to display a JSON Schema in their documentation.
It arose out of a personal itch and implements what I needed. Some features of JSON Schema are (not yet) implemented. Also I can imagine that other display layouts are desired.
Let me know in comments and perhaps pull requests.
Usage
The extension adds a single directive to Sphinx: jsonschema. You provide it with either an http URL to a schema or you may embed the schema inline.
Example
.. jsonschema:: http://some.domain/with/a/path/spec.json
Would fetch the spec.json file and display its contents.
Alternatively you can embed the schema:
.. jsonschema:: { "$schema": "This field is ignored for now. Perhaps use it to indicate schema version in display?", "title": "Test data set 1: **Simple type**", "id": "http://this.better.be.a.regular.domain", "description": "These data sets exercise `JSON Schema <http://json-schema.org>`_ constructions and show how they are rendered.\n\nNote that it is possible to embed reStructuredText elements in strings.", "type": "string", "minLength": 10, "maxLength": 100, "pattern": "^[A-Z]+$" }
Licence
Copyright Leo Noordergraaf, All rights reserved.
This software is made available under the GPL v3.
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
File details
Details for the file sphinx-jsonschema-1.0.tar.gz
.
File metadata
- Download URL: sphinx-jsonschema-1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dc87a8ed555bddfadf664e14f2287aa19dbfe908d3b227d291b180d8a7016d4 |
|
MD5 | fc8bf51574c10f16e05619bcde1b8932 |
|
BLAKE2b-256 | 7052f3287ed6bc170d4672781ff81c3aff5afa4b9e92e9e2d78216511b669f83 |