Git Product home page Git Product logo

describe-json's People

Contributors

vladiibine avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

describe-json's Issues

describe_json can not handle json strings spanning multiple lines. It should!

  • Describe JSON version: 0.1.4
  • Python version: *
  • Operating System: *

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

While this works:

$ describe_json <<< '{"a":"B"}'                         
{"a": "B"}

...this does not

$ describe_json <<ASDF                                 
heredoc> {
heredoc>  "a": "B"
heredoc> }
heredoc> ASDF
Traceback (most recent call last):
  File "/home/vardelean/ve/tmp3/bin/describe_json", line 11, in <module>
    sys.exit(main())
  File "/home/vardelean/ve/tmp3/lib/python3.6/site-packages/describe_json/__init__.py", line 210, in main
    json_describer.get_struct(json.loads(line))))
  File "/home/vardelean/.pyenv/versions/3.6.3/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/home/vardelean/.pyenv/versions/3.6.3/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/vardelean/.pyenv/versions/3.6.3/lib/python3.6/json/decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)

...because describe_json assumes the json strings will be presented completely on 1 line

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.