Git Product home page Git Product logo

json_schema_generator's People

Contributors

alotofnoodles avatar asharpe-squiz avatar catb0t avatar erikreed avatar gooseyard avatar perenecabuto avatar vinu76jsr 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

json_schema_generator's Issues

Add support for collections.OrderedDict

In my json decoder, I usually use json.loads(json_str, object_pairs_hook=OrderedDict), so that key-ordering is preserved. But the json_schema_generator does not support this:

json_schema_generator.schema_types.JsonSchemaTypeNotFound: There is no schema type for <class 'collections.OrderedDict'>.

On invalid json, log path that indicates what part of the validated json is invalid

Current behaviour:

  • On invalid message, the information on what part of the validated json is invalid is not passed.
    Expected behaviour
  • On invalid message, the information on what part of the validated json is invalid should be shown.

Please elaborate on that issue so that it is clear before implementation

Acceptance Criteria ?

additional information:

  • ValidationError contains "path" list field, which I assume to be indicator of where is the invalid part of validated json. That information is not used. Or at least I don't know where it is used and how to get it.

Seems to not work on Python 3.x

Suggestion: Make it more obvious that this requires something other than Python 3.x , or fix to make it work with Python 3.x .

Background: Since this is a relatively new module, I thought that it would be best to install Python 3.x (with pip and virtualenv) and run it with that. On a Mac, at least for a Python noob such as myself, that is something of a pain. I got a syntax error when trying to run this under Python 3.x . It works fine under the default Mac Python 2.7. At this time, I don't have time to reproduce that error.

Make "required" configurable

First of all thank you for the awesome tool! It is indeed very useful!

Currently when one reverse engineers the JSON Schema from the JSON - the required attribute is always set to true - this is in the generator.py file in the to_dict method - the schema_dict["required"] is hard coded to True.

It would be good if a command line option could be offered to to control this property - so users can generate schemas with all properties required or all not required.

Thank you!

PyPI release

The version uploaded to PyPI (0.3) still doesn't run in Python 3.

It would be great to have the latest version in PyPI as well, so we can use it in other libraries.
Can someone with the proper access do python setup.py dist upload? :)

PS: I can help to setup Travis to release to PyPI whenever there is a new tag, if you'd like that.

Required properties should be array on parent not boolean on children

In the example in the readme for this project, it appears as though the required properties are specified in the JSON schema by a required boolean property on each and every property which is required.

{
  "type": "object",
  "properties": {
    "name":      { "type": "string", "required": true },
    "email":     { "type": "string", "required": true },
    "address":   { "type": "string" },
    "telephone": { "type": "string" }
  }
}

However, the JSON schema specification indicates required properties are specified in the JSON schema by a required array on the parent that includes all child properties which are required.

https://spacetelescope.github.io/understanding-json-schema/reference/object.html?#required-properties

{
  "type": "object",
  "properties": {
    "name":      { "type": "string" },
    "email":     { "type": "string" },
    "address":   { "type": "string" },
    "telephone": { "type": "string" }
  },
  "required": ["name", "email"]
}

Please correct me if this is a mistake. Maybe this is a difference with previous versions of the JSON Schema specification?

License Agrement

I see a reference to the license in the setup.py - but it would be in the interest of adoption that a License.txt file be added explicitly in the package clearly stating the license the code is available under.

No module named json_schema_generator

I am new in python. I don't know how to solve this.

I am trying to execute the following command
python jsonschema_generator.py record example_movie.json schema_movie.json_schema

But I am getting the following error.
Traceback (most recent call last):
File "jsonschema_generator.py", line 9, in
import json_schema_generator
ImportError: No module named json_schema_generator

I executed the above command after navigating in bin folder. Please help me out

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.