-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge parser and generator API #23
Comments
Unfortunately not 😕 I've been scratching my head for a long time trying to find a common API for both the parser and the generator... but I'm not sure it will really happen. Instead, I think that for v4.0 I'm going to change the API of the generator to something more simple. My current thougth it to get rid of
Plain and simple. Anyway... my point is that in this new API, I could easy add helpers to write So that would solve your problem |
I want to help you to find a common API, so I will tell my thoughts..
|
You know what? The issue right now is that If we want to make only one I'll implement something among those lines, let's see where it goes... |
I made a lot of progress, there is still a lot to do but I think I can show you what the API will look like. New API for the generator:
As you can see, very few changes:
New API for the parser
Almost no change, |
I think this is a good starting point. Moving templates to StaticJsonBuffer is a nice solution. What about removing items? Is it possible with your allocation method? |
I'm really looking forward to the combined parser/generator. Would ease up things a lot. |
Actually, it's almost finished 😄 Still to be done:
Please have a look at branch 4.0. Be careful with the following points:
👉 Feedback is welcome. Please tell me what you think of it. 👈 |
Thanks for your effort! |
I would personally try to avoid binary data in JSON, but if I really needed to then I would go for base64 encoding. |
I tagged and released Arduino JSON 4.0 beta 1. Although it's marked as "beta", it's been heavily tested and can safely be used in new projects. |
Great work! |
Hi again,
Is there an easy way to convert a Parser::JsonObject to Generator::JsonObject? I have a good reason to do this :)
The text was updated successfully, but these errors were encountered: