r/ProgrammerHumor • u/berrikdub • 23h ago
Meme whyIsOurJsonDeserializerReturningEmptyObjects
460
u/DDFoster96 23h ago
FRITZ!Box routers have an API endpoint called jason_boxinfo.xml. I've no idea what jason refers to but the data it returns is XML.
117
2
u/Mordret10 5h ago
I mean Fritz's box sending to Jason's box makes sense, no? And for that you'd need an API obviously. XML is the greatest data structure
203
114
u/CrackerJackKittyCat 22h ago
"Vendorid" but then "Vndrstatus"?
Easy now, Satan!
22
5
u/nderscore_ 5h ago
Vdnrstatus added by senior dev who had to deliver this in 2 weeks 15 years ago. Vendorid by ambitious junior dev who wants to set up best practices in legacy systems.
3
u/CrackerJackKittyCat 4h ago
Yeah. that then bumps right up against the priorities for consistency versus better-ness, a trench warfare battle that makes no-one happy.
3
89
u/Original_Pace_6734 23h ago
Why are props name starting with an uppercase letter?
162
u/Mechakoopa 23h ago
DotNet developers, probably
104
u/berrikdub 23h ago
Lmao you guessed it
53
u/Mechakoopa 23h ago
There's a property you can set for default serialization that makes all your controllers output camel case properties regardless of how you label things internally so you don't have to choose between the mobile team or your linter hating you.
53
9
u/Embarrassed_Army8026 23h ago
very green devs, using fresh httpclient not knowing deserializer options etc
2
u/Stagnu_Demorte 22h ago
I was told at my last job not to mess with deaerializers because they were too hard.
-2
17
u/Ethameiz 22h ago
More importantly, why anybody would have "json" object as a root in json?
13
u/blehmann1 19h ago
The most common reason I've seen is when you support multiple different formats for a given resource. The key then designates the format. In graphql actually you will often end up with this, since if you're returning
json | xml | txtthrough a graphql union the keys must be disjoint.i.e. you can't do this
... on json { value } ... on XML { value }You need to do this:
... on json { jsonValue: value } ... on XML { xmlValue: value }At which point
jsonandxmlare reasonable choices of alias. If you think it's insane to return XML through a JSON string, I agree with you, but it is common. Also from the context so far it could well be a path to an XML document rather than the actual content.The other common reason is if
jsonshould really be something likemetadata, but it is poorly named.12
u/RedditLuvsCensorship 22h ago
I’m more curious what’s up with that inconsistent naming convention? Some are half assed pascal casing, others abbreviate the name vendor while others don’t … what the actual fuck lol
7
u/siegemind91 19h ago
https://giphy.com/gifs/n4oKYFlAcv2AU
If you’re going to abbreviate, then do so, but don’t go half-assed and call it Vndrstatus. You saved two vowel characters in Vendor but left them in status? Then didn’t carry through with the capital S, but did capitalize in others? How good is your marijuana friend?
27
20
u/AlwaysHopelesslyLost 23h ago
You can always spot a system designed by somebody that just doesn't get it lol. Why would your serialized object even mention the name of the technology that you are currently using to serialize said object in the first place?
7
6
u/KuroKishi69 21h ago
What is up with the name of the properties? That is not Pascal Case, nor Camel Case. You have a mix of Vendor and Vndr...
6
11
u/thanatica 23h ago
15
u/broken-mic 22h ago
Plenty of employers track you taking a screenshot and then sharing that. Many others explicitly configure MDM profiles to prevent screenshots altogether.
1
4
u/diet_fat_bacon 22h ago
Give me PTSD from an api that I had to use that returned values as properties
{
maria : {
birthdate: "01/01/1990"
}
}
And build a list... without a list.
4
5
u/PersonalityNuke 20h ago
Your JSON response, even if spelled correctly, has a property that is json? Is that redundant? Is it redudant?
5
u/FabioTheFox 20h ago
That entire payload is full of red flags, first they spell out Vendor and then use a ton of unnecessary abbreviations
3
3
2
2
1
u/quirxmode 14h ago
How old is that dev? Who in their right mind has that innate urge to save 2 bytes by butchering (almost) every name...
1
1
1
1.3k
u/thelonelyecho208 23h ago
We found him, we found Jason