top | item 41784139

(no title)

Aditya_Garg | 1 year ago

Thats only because your list has different types. Its a badly formed API and if you really need to support that use case then you can use maps and reflection to handle it.

discuss

order

est|1 year ago

The problem is, programmers can't dictate what JSON should look like in the wild.

We used to have strict typed XML. Nobody even bothered.

a57721|1 year ago

> The problem is, programmers can't dictate what JSON should look like in the wild.

Not JSONs in general, but a sane API would never return something like that.

> We used to have strict typed XML. Nobody even bothered.

Nowadays there is OpenAPI, GraphQL, protobuf, etc. and people do bother about such things.

shiroiushi|1 year ago

>We used to have strict typed XML. Nobody even bothered.

Yeah, because it was ugly as hell and not human-readable.