Sign inSign up

imochoa/json-schema-viewer

By imochoa

Updated about 4 years ago

Dockerized version of https://github.com/jlblcc/json-schema-viewer

Image
0

276

imochoa/json-schema-viewer repository overview

Running

Run the demo page at localhost:9001:

docker run --rm -it -p 9001:9001 imochoa/json-schema-viewer

Or mount your own schemas using:

docker run --rm -it -p 9001:9001 -v `realpath schemas`:/var/www/schemas/schema imochoa/json-schema-viewer

For that to work, you should follow some rules:

  • the top-level schema file must exist at /var/www/schemas/schema/schema.json
    • that schema should contain the following fields
    "version": "1.1.3",
     id": "schema.json#",
    

/var/www/schemas/ tree

Besides the schema.json and its referenced nested schema JSON files, you can also add more functionality:

/var/www/schemas/
├── examples
│   ├── A.json
│   ├── B.json
│   └── C.json
├── schema
│   ├── schema
│   │   ├── A.json
│   │   ├── B.json
│   │   └── C.json
│   └── schema.json <- top-level schema!
└── templates
    └── mdJson_template.json

The relative position between the schema.json and A.json, B.json, C.json depends on the $ref: values (eg. no nesting: "$ref": "A.json" or nested "$ref": "schema/A.json"

For more info, see gist

dev paths
  • grunt dev schemas
    • /opt/json-schema-viewer/bower_components/mdjson-schemas/schema/
  • grunt prod schemas
    • ~/opt/json-schema-viewer/prod/0.3.4/20220817/1/
    • symlinked to /var/www/schemas

Tag summary

Content type

Image

Digest

sha256:9cef5998f

Size

400.8 MB

Last updated

about 4 years ago

docker pull imochoa/json-schema-viewer