Comments (6)
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.
Thank you guys
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.
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.
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.
That would be great! Thanks!
from arduinojson.
Feature available in ArduinoJson 5.0 beta 2.
from arduinojson.
Related Issues (20)
- Cannot compile code that compiled last time it was used HOT 1
- There is a memory leak either in this library or in ESP32 LittleFS HOT 23
- Lint error ovl_no_viable_subscript has occured HOT 2
- Cleaning HTML Chuking Answer at the Custom Reader class for getting filtered JsonDocument HOT 1
- Return JsonDocument from class methods HOT 2
- Question - Access JSON data variables in nested arrays HOT 5
- Problem whith a JSON from Firefox to my ESP8266 HOT 3
- Capped Allocator HOT 4
- fatal error: ArduinoJson/Variant/VariantRefBase.hpp: No such file or directory HOT 1
- Example on ArduinoJson website crashes at runtime HOT 1
- ArduinoJson 7.1.0 Compile error [ invalid use of array with unspecified bounds ] HOT 2
- Missing links to specific types in the API reference HOT 1
- Queuing ArduinoJson objects HOT 3
- Deallocator problem (probably) on ESP32-WROVER-E HOT 3
- Compile errors with new IDE?
- Custom reader: readBytes method is not required? HOT 1
- 'struct SpiRamAllocatorST' has no member named 'reallocate'; did you mean 'deallocate'? HOT 5
- Some trouble using variables as element names in JsonDocument HOT 4
- cppcheck: failed to expand 'ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE' HOT 3
- containsValue() method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinojson.