Coder Social home page Coder Social logo

Comments (6)

acasadoalonso avatar acasadoalonso commented on May 11, 2024

I concur …. see my post
http://forum.arduino.cc/index.php?topic=172578.new#new http://forum.arduino.cc/index.php?topic=172578.new#new

Thanks so much for such a great job.
AC/.

On 09 Jan 2015, at 18:15, Peter Polidoro [email protected] wrote:

You have written a great library, thank you so much! Your code in version 4 looks really clean, I am impressed. It seems that now the JSON parser only operates in what you were calling strict-mode in your previous version. Now if the JSON is not well formed it returns an error instead of parsing in a non-strict manor. Would you consider replacing the original non-strict parsing behavior? Perhaps that would ruin the cleanliness of your new code and it is not reasonable to expect a JSON parser to handle ill formed strings, but I did think it was really nice when your previous code gracefully accepted what now it simply rejects. Previously it seemed that strings inside the JSON did not necessarily need quotation marks, and tokens could be separated with spaces as well as commas. Perhaps even more was allowed through the old non-strict parser that other more strict parsers would reject. I am using your library to parse JSON that I type on a command line and your previous non-strict ve rsion saved me from having to type lots of characters that I now need to add. Perhaps I am being lazy and sloppy, but would you please consider restoring the old behavior, at least as an option?


Reply to this email directly or view it on GitHub #44.

from arduinojson.

bblanchon avatar bblanchon commented on May 11, 2024

Thank you guys :bowtie:
I do make an effort to make the code clear and well tested.

But what I care even more is the code size.
When writing version 4, I first tried to keep that feature, but I finally removed it because it was much simpler without it and allowed more code reuse.

I'll have a look but even if I manage to do it, the code will be significantly bigger so that'll be an optional feature.

from arduinojson.

peterpolidoro avatar peterpolidoro commented on May 11, 2024

Perhaps it is better to keep version 4 nice and small. I can just continue to use version 3 for non-strict parsing. Or maybe you can consider adding a non-strict parsing git branch to version 4, so only those who really want that feature have all the extra code. Maybe that is too much for you to have to maintain though. Thanks for looking at it!

from arduinojson.

bblanchon avatar bblanchon commented on May 11, 2024

I think I'll add a new function to sanitize the JSON string before parsing.
You'll have to call that function yourself, like this:

char json[64] = "{key:value}";
sanitizeJson(json, sizeof(json));
JsonObject& root = jsonBuffer.parseObject();

That way the overhead will only be included if you need the non-strict mode but it would have zero impact for programs that don't need it.

Would that be suitable for you guys?

from arduinojson.

peterpolidoro avatar peterpolidoro commented on May 11, 2024

That would be great! Thanks!

from arduinojson.

bblanchon avatar bblanchon commented on May 11, 2024

Feature available in ArduinoJson 5.0 beta 2.

from arduinojson.

Related Issues (20)

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.