4 ms·
JSON schema exist exactly for that reason, hacks like adding type is just nonsense. If somebody need comments, types it - XML has all that. Also how hard is to
by nooorofe 6y ago
JSON schema exist exactly for that reason, hacks like adding type is just nonsense. If somebody need comments, types it - XML has all that. Also how hard is to write {"type": "datetime", "value": "2021-02-23 12:46:37.07"}?
- BugsJustFindMe 6y ago> JSON schema exist exactly for that reason, hacks like adding type is just nonsense Creating schemas for declaring types is literally a hack for adding type! I think its very bizarre to say "You dont need to do X because you can just do X." > Also how hard is to write {"type": "datetime", "value": "2021-02-23 12:46:37.07"} "datetime" isn't a universal format specification. 2021-01-10 could be October 1 or January 10. What time zone is this in? Local to the sender, UTC, local to the recipient, somewhere else? Is this a 24 hour clock or something that gets a modifier for the other half of the day? You're making some classic mistakes that people make when they don't think about the complexity of the problem domain of communicating information unambiguously.
- nooorofe 6y ago> Creating schemas for declaring types is literally a hack for adding type! It is a "communication protocol" - base of any messaging system. Message has header with protocol name and version: HTTP, TCP, DB connection, SOAP, any message queue - everything working that way. > "datetime" isn't a universal format specification. than use another (see the comment above) self-contained message is anti-pattern