GithubHelp home page GithubHelp logo

sample-json-schemas's Introduction

What this repository is

This repository contains sample JSON Schemas for various JSON-based formats found around the web.

There are many such formats, and this repository contains schemas for whatever formats I happened to stumble upon.

Existing schemas in this repository

This repository contains schemas for the following:

Note: these schemas are probably not perfect. See below.

How these schemas are written and tested

I use my toy site to check both the validity of the schema syntax, and the validation of data against these schemas.

This site uses my library, which I am fully confident about. But I am not that confident about the schemas themselves.

I have read the relevant specifications, but I certainly have missed some points in them, and as a result these schemas may not be accurate. Not to mention that some constraints expressed by these specifications are not enforceable by JSON Schema.

Requests and contributions

Both are welcome:

  • if you stumble upon a JSON data format which you would like a JSON Schema for, feel free to open a feature request so that a schema be written for that format;
  • if you spot an error on a schema (data which should validate but does not, or the opposite), you can provide sample data and the expected and actual results, using the site above; or you can submit a pull request to improve the schema itself;
  • if, on the other hand, you have written a schema for an existing format, and wish to add it to this repository, you are welcome to open a pull request so that this schema be included in the examples. Provided that you are ready to comply to the...

Licensing conditions

The licensing conditions are the same as they are for JSON Schema itself: content in this repository may be licensed under either of the AFL or BSD license.

sample-json-schemas's People

Contributors

fge avatar mpcm avatar patefacio 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

sample-json-schemas's Issues

questionable schema

Maybe my parser is not correct, but to get my code to parse some of the schema I had to make a few changes, shown below. I honestly did not try to understand the details of these schema, but was just trying to grab some valid schema on the net to pass through a visualizer I'm working on. These schema and a couple more can be viewed at: https://github.com/patefacio/json_schema/tree/master/dot_samples/schemaout

Hopefully these changes are helpful, but I'm not sure.

diff dot_samples/original/avro-schema.json dot_samples/schemas/avro-schema.json 
32,33c32,33
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
48,49c48,49
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
101,102c101,102
<                 "name": { "$ref": "#/definitions/nameOrNamespace" },
<                 "nameOrNamespace": { "$ref": "#/definitions/namespace" },

---
>                 "name": { "$ref": "#/definitions/name" },
>                 "nameOrNamespace": { "$ref": "#/definitions/nameOrNamespace" },
110a111,115
>         "name": {
>             "description": "what a name can be",
>             "type": "string",
>             "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
>         },
bash-3.2$ diff dot_samples/original/json-home.json dot_samples/schemas/json-home.json 
95c95
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
102c102
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
114c114
<                     "uniqueItems": "true",

---
>                     "uniqueItems": true,
bash-3.2$ diff dot_samples/original/crs.json dot_samples/schemas/crs.json 
32c32
<         "linkObject": {

---
>         "linkedObject": {
47c47
<         "linkedCRS": {

---
>         "linkedCrs": {

Updates to JSON-RPC 2.0 Schemas

Hi, these items need addressing in the schemas:

Request: This needs to be either a single instance of the current definition, or an unbound array of such objects (batch). Other than that I think it looks good.

Response: Result can be any type, not just an object. Same thing about batch, and needing to be an instance or an array of instances.

Handling in general should be to use the confirm the object shape, but not exclude any additional data fields.

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.