- cross-posted to:
- programmer_humor@programming.dev
- cross-posted to:
- programmer_humor@programming.dev
Meme transcription:
Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?
Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”
JSON has types.
Many API developers may choose not to use them, but they are absolutely there.
You specify the type by including or excluding quotation marks, and then for the types without quotation marks, you either include or exclude a decimal point to specify float or integer, and for boolean you use characters (specifically
true
orfalse
). Arrays are wrapped in[]
and objects are wrapped in{}
.JSON data as a whole is passed as one giant string because the REST protocol demands it. But once it’s been pulled in and properly interpreted, there are absolutely types in the data.
Great post, but I have to “well, actually” you on this little thing:
REST is not a protocol, and does not have to do anything with JSON.
(eg. How Did REST Come To Mean The Opposite of REST? by Carson Gross)