this post was submitted on 21 Feb 2025
92 points (96.9% liked)
Programming
18422 readers
603 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I've seen XML parsers that will convert element content from strings to native types by default. So "0" becomes an int, "true" becomes a boolean, and "null" becomes an actual null. I had to take extra steps to keep everything as a string unless explicitly told not to.
JSON does not have this problem, BTW.
I don't think anyone actually chooses XML. There's no reason to use it over JSON unless you need to.
XML can validate itself and there's the self-documenting WSDL; so while it has more overhead and an ugly syntax it can make for a more stable and earlier to understand API for your API's consumers.
This point is always stated about XML as if it were the most important part of choosing XML.
But jsonschema exists. It has the same capability.
Ah but... Nobody uses that! Because then you wouldn't choose JSON