Code Monkey home page Code Monkey logo

bootprint-json-schema's Introduction

bootprint-json-schema

Greenkeeper badge

NPM version Travis Build Status Coverage Status

Converts a json-schema into a static html page

This module is meant for use with the bootprint module:

npm install -g bootprint
npm install -g bootprint-json-schema
bootprint json-schema http://json-schema.org/schema target

The directory "target" should now contain a file index.html and main.css which contain a readble form of the Core/Validation Meta-Schema.

API-reference

License

bootprint-json-schema is published under the MIT-license. See LICENSE for details.

Release-Notes

For release notes, see CHANGELOG.md

Contributing guidelines

See CONTRIBUTING.md.

bootprint-json-schema's People

Contributors

alexec avatar greenkeeper[bot] avatar nknapp avatar ramsey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bootprint-json-schema's Issues

Support for external references

References like

{
     "$ref": "http://example.org/other-schema.json
}

might be rendered correctly already. But it should be possible to provide an alternative link location to a static documentation of the target schema.

Navigational element

There should be a table of contents or a navigation-element on the left to get a better overview over the schema.

Support for "oneOf"

When generating documentation for a schema that contains a type defined with oneOf, there is no documentation generated for those possible items from the oneOf definition.

Given the following schema:

{
  "title": "Example json-schema: oneOf where the elements are references.",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "This schema has two properties: a type that is defined by 'oneOf', where the items within are references to other types.",
  "properties": {
    "oneOfWithReferences" : {
      "description": "Some type, that can be one of 2 different types, defined by a reference.",
      "oneOf": [
        { "$ref": "#/definitions/one" },
        { "$ref": "#/definitions/two" }
      ]
    },
    "oneOfInline" : {
      "description": "Some type, that can be one of 2 different types, defined in-line",
      "oneOf": [
        { "type": "string" },
        { "type": "number" }
      ]
    }
  },
  "definitions": {
    "one" : {
      "description": "Number one of the types that `oneOfWithReferences` is allowed to be",
      "type": "string" },
    "two" : {
      "description": "Number two of the types that `oneOfWithReferences` is allowed to be",
      "type": "number"
    }
  }
}

When running

$ bootprint json-schema filename-of-schema-above.json out
Loading bootprint-json-schema 1.1.0
Loading bootprint-base 1.1.0
[ 'out/index.html',
  'out/main.css',
  'out/main.css.map',
  'out/bundle.js',
  'out/bundle.js.map' ]

When opening index.html in a browser; I see the following:

screenshot from 2018-03-30 16-02-01


Expected:

The types oneOfWithReferences and oneOfInline should have a list of possible subtypes. For oneOfInline you'd expect the sub-types to be rendered "in line" if possible. For oneOfWithReferences you'd expect a list of links to the allowed sub-types.

Include Examples in the output

I have examples in my schema and would like them included in the output. Is this possible?

{
  "title": "Metadata",
  "description": "Metadata about a piece of media and its status in the system",
  "type": "object",
  "properties": {
    "name": {
      "description":
        "The human readable name of the media. This defaults to the name of the file on the user file system when it was uploaded.",
      "type": "string",
      "examples": ["some-awesome-file.txt", "rick-roll.mp4"]
    }
  }
}

TypeError: qfs.isDirectory is not a function when using "develop" mode

What I did:

Attempted to use bootprint json-schema in "developer" (watch) mode.

Steps to repro:

Assuming you have a json file TEST.json:

  • npm install -g bootprint bootprint-json-schema
  • bootprint json-schema ./TEST.json output/ -d

What I expected to happen:

File watcher starts, files are generated.

What actually happens:

Crashes with TypeError: qfs.isDirectory is not a function within customise-watch.

More details

There seems to be a complex dependency tree here, but reproduction is trivial.

Full stack trace is:

BenMBP:bootprint-json-schema ben$ bootprint json-schema ../bootprint/examples/content.yaml tmp/ -d
Loading bootprint-json-schema 1.1.0
Loading bootprint-base 1.1.0
Serving "tmp/" at http://127.0.0.1:8181
Ready for changes
/Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/q/q.js:155
                throw e;
                ^

TypeError: qfs.isDirectory is not a function
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/customize-watch/lib/watcher.js:43:22
    at Array.map (<anonymous>)
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/customize-watch/lib/watcher.js:39:18
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/lodash/index.js:3073:15
    at baseForOwn (/Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/lodash/index.js:2046:14)
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/lodash/index.js:3043:18
    at Function.<anonymous> (/Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/lodash/index.js:3346:13)
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/customize-watch/lib/watcher.js:35:7
    at _fulfilled (/Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/q/q.js:854:54)
    at /Users/ben/.nvm/versions/node/v10.16.3/lib/node_modules/bootprint/node_modules/q/q.js:883:30
BenMBP:bootprint-json-schema ben$

This function was added in m-io v0.5.0 (nknapp/m-io@932d674) and while I tried to fix this with sufficient cloning of various bootprint repos, and editing various package.json files, I simply ran out of talent.

Most of the dependencies declare that they require m-io 0.3.1 but clearly customise-watch requires 0.5.0 however, the customize-watch that gets installed declares that it requires 0.3.1.

I've raised this here, rather than at bootprint/customize-watch because I found this issue here and it doesn't appear to happen in the bootprint tests (I checked this too).

An in-range update of handlebars is breaking the build 🚨

Version 4.0.7 of handlebars just got published.

Branch Build failing 🚨
Dependency handlebars
Current Version 4.0.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As handlebars is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details - ❌ **continuous-integration/travis-ci/push** The Travis CI build failed [Details](https://travis-ci.org/bootprint/bootprint-json-schema/builds/227224377?utm_source=github_status&utm_medium=notification),- βœ… **coverage/coveralls** First build on greenkeeper/handlebars-4.0.7 at 65.909% [Details](https://coveralls.io/builds/11305037)

Commits

The new version differs by 10 commits0.

  • 606fa55 v4.0.7
  • 8e09f0e Update release-notes for 4.0.7
  • c8f4b57 Fix context-stack when calling block-helpers on null values
  • b617375 Parser: Change suffix to use ES6 default module export
  • 63a8e0c Add more tests for partial-blocks and inline partials
  • 5a164d0 Fix for #1252: Using @partial-block twice in a template not possible
  • 01b0f65 Avoid duplicate "sourceMappingURL=" lines.
  • 406f2ee require('sys') is deprecated, using 'util' instead
  • a023cb4 Make "column"-property of Errors enumerable
  • c7dc353 Testcase to verify that compile-errors have a column-property

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

Version 3.4.2 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
  • βœ… coverage/coveralls First build on greenkeeper/mocha-3.4.2 at 65.909% Details

Release Notes fake-success

3.4.2 / 2017-05-24

πŸ› Fixes

πŸ”© Other

Commits

The new version differs by 7 commits.

  • a15b20a :ship: Release v3.4.2
  • fc802a9 :memo: Add Changelog for v3.4.2
  • 10ff0ec Eagerly set process.exitCode (#2820)
  • fc35691 Merge pull request #2818 from makepanic/issue/2802
  • 3e7152f Remove call to deprecated os.tmpDir (#2802)
  • e249434 Merge pull request #2807 from mochajs/npm-script-lint
  • 17a1770 Move linting into an npm script. Relates to #2805

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.