-
Notifications
You must be signed in to change notification settings - Fork 621
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Why use JSON instead of YAML for Section definition? #1321
Comments
I think the reason for JSON is that there is a better abstraction between Arrays and Hashes/Objects. Whereas in YAML it can be hard to differentiate what data type is what. My main problem with JSON is having to use string keys gets me (ie. Could we possibly also support quoteless keys in our JSON for simple developer ease. Ex.
This should be totally possible since we are completely in charge of parsing the JSON. |
We can just use HJSON. JSON Add-Ons:
Thats all it does. Seems like the perfect solution to me. Heres the ruby gem: https://github.com/hjson/hjson-rb |
Could be just as simple as changing these three load statements methods in https://github.com/locomotivecms/steam/search?q=MultiJson&unscoped_q=MultiJson |
Maybe we could avoid this whole HJSON support if section definitions supported both YAML and JSON |
@westonganger I like your suggestion! let me see if I can add it for v4. |
@westonganger @DonKoko @manuchap @thibaultrey |
Everything else is YAML so I would say that should be the default. |
I really got used to the JSON but I agree with @westonganger that YAML would be more consistent with the rest. |
@DonKoko @westonganger next steps:
|
thanks again @westonganger. YAML is definitively the best choice. So simple to read and write compared to JSON. Besides, thanks to the Liquid HTML ST3 plugin, I've got the perfect code highlighting to read liquid pages. |
I think its great that we have both options. I have to disagree that YAML is better when it comes to complex data structures, as for a person who never user YAML, its super confusing how do you manage arrays and objects, and with JSON it follows the conventions that we all know and love, arrays with [] and objects with {}. This can make it very confusing to debug, especially considering how dependent it is on indentation. I personally would not use it, but again, i think its a good option to have. |
I'm like 50/50 on this. Maybe 51/49 towards json since js devs and apis use it a lot and it fits well with wagon sync and mongo which I hope will never be replaced with potgresql 😅 |
Is there a reason why we are using JSON instead of YAML for the sections definition? This feels a little jarring, considering YAML is used for everything else.
The text was updated successfully, but these errors were encountered: