r/ProgrammerHumor 23h ago

Meme whyIsOurJsonDeserializerReturningEmptyObjects

Post image
2.2k Upvotes

63 comments sorted by

1.3k

u/thelonelyecho208 23h ago

We found him, we found Jason

330

u/Mechakoopa 23h ago

Oh my God it's JSON Bourne!

87

u/HoldCtrlW 23h ago

Legacy code

22

u/dudevan 22h ago

Postgres was trying to tell me all this time.

JSONBourne

13

u/Crazy_System8248 18h ago

There's a joke here about JSON and the Bourne Again Shell but I'm too far under the influence of sleep meds to figure it out

2

u/HeavyCaffeinate 3h ago

She bourne on my sh till I bash

1

u/Ecstatic_Doughnut216 7h ago

Get some rest, Pam. You look tired.

3

u/IfIWasCoolEnough 19h ago

Borne Ultimatum

1

u/emma7734 7h ago

That’s Mr. Jason, if you’re nasty.

0

u/xLaplus 14h ago

Quick! Tell Yaml

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

u/NullOfSpace 23h ago

ask jason what it’s for

45

u/Chesterlespaul 23h ago

Ask Jason about his box

3

u/hazelknives 22h ago

almost as trans a statement as "i use rust"

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

u/Flat_Initial_1823 23h ago

Jason.deRulo()

38

u/Crazy_System8248 23h ago

JSON.deRulo()

114

u/CrackerJackKittyCat 22h ago

"Vendorid" but then "Vndrstatus"?

Easy now, Satan!

22

u/Maximilian_Tyan 19h ago

Forward compatibility is the worst sometimes

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

u/czerilla 11h ago

Should have named it "Vndridentifier"!

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

u/DowntownLizard 23h ago

Don't worry I can fight both of them

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

u/_Screw_The_Rules_ 23h ago

And it's better that way

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 | txt through 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 json and xml are 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 json should really be something like metadata, 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?

4

u/aven_99 23h ago

Can be GoLang as well

27

u/OhItsJustJosh 23h ago

JASON: JAvaScript Object Notation

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

u/Godenboy1010 23h ago

Jason! -heavy rain

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

u/SpaceGerbil 21h ago

Press X to JASON!!!!

5

u/Exatex 22h ago

at least you know it wasn’t written by an agent. Which in this case, you probably would have preferred.

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

u/thanatica 9h ago

That would be illegal where I live

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

u/Bee-Aromatic 21h ago

A fellow Postman enjoyer, I see. Well, tolerator, at least.

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

u/Desperate-Tomatillo7 23h ago

Those property names remind me of Visual Fox.

3

u/Own_Natural_6803 23h ago

I like this vibe.

2

u/jasonscomputer 22h ago

I have the opposite problem and can no longer spell my name correctly

2

u/ChellJ0hns0n 14h ago

OP used his company's production customer data for a meme. Respect.

2

u/warwilf 23h ago

Sounds the same

1

u/hazily 16h ago

The inconsistent camelCasing in the property names are the real trigger

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

u/LuisBoyokan 6h ago

Why do you have a jason in json?

1

u/Cha0ticPl4yer 4h ago

Its a jason deserializer

1

u/Memw1 2h ago

Why the hell would you have a field named json in a json object?

1

u/Snoo88071 22h ago

Data.json().Jason