Giter VIP home page Giter VIP logo

json-schema-dev's Introduction

jsonschema.dev

What is this?

This is the repository for the code that runs the jsonschema.dev website.

jsonschema.dev is a web based JSON Schema playground.

JSON Schema is a vocabulary allow for the validation and annotation of JSON documents... and a few other things.

Why?

Running the JSON Schema slack server has demonstrated there is no solution to easily test and share JSON Schema documents. There are other web based tools which offer a JSON Schema playground, however they run validation on the server, while jsonschema.dev runs all validation in browser using ajv.

This tool enables the JSON Schema community to find help easier in the same way jsfiddle enabled the javascript community to share and demo problems and solutions.

JSON Schema?

The chances are that if you're here, you probably don't need selling on the idea that JSON Schema is pretty useful... but just in case:

JSON Schema is a personal IETF draft specification proposal. According to the IETF definition of personal drafts, it's not advised to actually use the specification, and is intended to test concepts and gather feedback, however JSON Schema has been used in production by many top companies for years.

The OpenAPI specification (formally Swagger) uses a subset of JSON Schema specification to define payloads.

The main javascript package for JSON Schema boasts many dependants, including Webpack and eslint.

The most popular text editor / IDE, Microsoft's VS Code, supports JSON Schema validation out of the box.

Here are some of the other companies and organisations that use JSON Schema, from a presentation. (These are not endorsements.)

Image of orgs

Contributing

If you would like to contribute to this project, please follow this basic guide. A more detaild guide to follow.

  • Check to see if an issue for your suggestion or requirement already exists
  • Create a new issue detailing your suggestion or problem, including examples if possible
  • Issues that are approved (agreed on) are now awaiting a Pull Request
  • Pull Requests should always be made against the develop branch
  • Pull Requests should never be made against the master branch

This project uses vue.

It is expected that you have some familairty with CLI and node.

It's recommended that you use nvm to install and manage node.

You will need to install node (probably using nvm) and then yarn (an alternative to npm).

Once installed, check out this git repository and run yarn with the repository root as your current working directory.

For local development, run yarn run serve.

For production build test, run yarn run build.

For more details, see the Vue CLI docs.

jsonschema.dev is automagically deployed to netlify using the master branch.

Netlify also provides Pull Request previews, which will automagically appear when a PR is created or new commits are pushed to the associated branch.

I have questions...

Super!

You can reach me on twitter or on the official json-schema.org slack

I'd like to support this work

Great! Please see the sponsor links at the top of this page.

json-schema-dev's People

Contributors

dependabot[bot] avatar hugo avatar relequestual avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

json-schema-dev's Issues

Use larger font size for inputs on mobile

iOS will "zoom" the page in when selecting an <input /> or <textarea /> with a font size less than 16. This "breaks" the layout and leads to a suboptimal experience. Also, small font sizes are hard to read for many users, so it's not the best UX anyway.

Auto-select link text on mobile

Tapping in the "share" textbox selects the text automatically on desktop, but not on mobile (or at least not on iOS). For consistency of UX, it should work across all platforms.

Improve use of space

There is a lot of "dead" space in the current design. The "active" parts of the UI could be rearranged to make better use of the user's available screen space.

Screenshot 2019-06-09 at 11 40 30

Use URL segment for share links

Rather than using the query parameter (?shareData=abcdef) for share links, use a URL segment (/s/abcdef). This is slightly shorter and slightly neater.

bug: `unevaluatedProperties` is not working properly

I was reading #550 to understand the behavior of unevaluatedProperties and when testing the below example

image

on jsonschema.dev, I found that the validation result does not match what is expected by the example.

for this schema

{
    "title": "Vehicle",
    "type": "object",
    "oneOf": [
        {
            "title": "Car",
            "required": ["wheels", "headlights"],
            "properties": {
                "wheels": {},
                "headlights": {}
            }
        },
        {
            "title": "Boat",
            "required": ["pontoons"],
            "properties": {
                "pontoons": {}
            }   
        },  
        {
            "title": "Plane",
            "required": ["wings"],
            "properties": {
                "wings": {}
            }
        }
    ],
    "unevaluatedProperties": false
}

the instance { "headlights": {}, "pontoons": {} } should fail, but it is unexpectedly passing. (check this)

Refactor component structure

A significant amount of logic and layout for the app is currently in App.vue. This is fine for an MVP, but before adding more complexity it would be helpful to decompose the application into a number of smaller, easier to understand, easier to edit parts.

Improve editor experience

Currently the editor windows are a fixed size. It would be useful if it were possible to toggle between showing both the schema and instance, just the schema, or just the instance. This feature is common on online editors such as CodeSandbox, JSBin, JSFiddle, etc.

Catch unresolveable references

Currently, if a $ref is unresolveable, the error is not reported to the end user and results in an uncaught error.

Example:

{
  "type": "object",
  "$ref": "foo.json"
}

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.