Git Product home page Git Product logo

json_schema_generator's Introduction

JSON Schema Genarotor

About

It is a json schema genarator from any json source.

Usage

See Usage

Example

Since you have a json file with the above structure":

    {
        "item_1": "string_value_1",
        "item_2": 123,
        "item_3": [1, 2, 3],
        "item_4": true,
        "item_5": null,
        "item_6": { "key": "value"},
        "item_7": {
            "item_7.1": "string_value_1",
            "item_7.2": 123,
            "item_7.3": [1, 2, 3],
            "item_7.4": true,
            "item_7.5": null,
            "item_7.6": { "key": "value"}
        }
    }

It should generate a json schema as":

    {
        "$schema": "http://json-schema.org/draft-03/schema",
        "id": "#",
        "required": true,
        "type": "object",
        "properties": {
            "item_1": {
                "id": "item_1",
                "required": true,
                "type": "string"
            },
            "item_2": {
                "id": "item_2",
                "required": true,
                "type": "number"
            },
            "item_3": {
                "id": "item_3",
                "required": true,
                "type": "array" ,
                "items": {
                    "id": "0",
                    "required": true,
                    "type": "number"
                }
            },
            "item_4": {
                "id": "item_4",
                "required": true,
                "type": "boolean"
            },
            "item_5": {
                "id": "item_5",
                "required": true,
                "type": "null"
            },
            "item_6": {
                "id": "item_6",
                "required": true,
                "type": "object" ,
                "properties": {
                    "key": {
                        "id": "key",
                        "required": true,
                        "type": "string"
                    }
                }
            },
            "item_7": {
                "id": "item_7",
                "required": true,
                "type": "object" ,
                "properties": {
                    "item_7.1": {
                        "id": "item_7.1",
                        "required": true,
                        "type": "string"
                    },
                    "item_7.2": {
                        "id": "item_7.2",
                        "required": true,
                        "type": "number"
                    },
                    "item_7.3": {
                        "id": "item_7.3",
                        "required": true,
                        "type": "array" ,
                        "items": {
                            "id": "0",
                            "required": true,
                            "type": "number"
                        }
                    },
                    "item_7.4": {
                        "id": "item_7.4",
                        "required": true,
                        "type": "boolean"
                    },
                    "item_7.5": {
                        "id": "item_7.5",
                        "required": true,
                        "type": "null"
                    },
                    "item_7.6": {
                        "id": "item_7.6",
                        "required": true,
                        "type": "object" ,
                        "properties": {
                            "key": {
                                "id": "key",
                                "required": true,
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }

json_schema_generator's People

Contributors

perenecabuto avatar vinu76jsr avatar

Watchers

 avatar  avatar

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.