[-] expr@programming.dev 2 points 15 hours ago

It's about making APIs more flexible, permissive, and harder to misuse by clients. It's a user-centric approach to API design. It's not done to make it easier on backend. If anything, it can take extra effort by backend developers.

But you'd clearly prefer vitriol to civil discourse and have no interest in actually learning anything, so I think my time would be better spent elsewhere.

[-] expr@programming.dev 0 points 15 hours ago

As I already said, it's very simple with JSON Patch:

[
  { *op": "replace", "path": "/Name™, "value": "otherName"}
]

Good practice in API design is to permissively accept either undefined or null to represent optionality with same semantics (except when using JSON Merge Patch, but JSON Patch linked above should be preferred anyway).

[-] expr@programming.dev 0 points 18 hours ago

The semantics of the API contract is distinct from its implementation details (lazy loading).

Treating null and undefined as distinct is never a requirement for general-purpose API design. That is, there is always an alternative design that doesn't rely on that misfeature.

As for patches, while it might be true that JSON Merge Patch assigns different semantics to null and undefined values, JSON Merge Patch is a worse version of JSON Patch, which doesn't have that problem, because like I originally described, the semantics are explicit in the data structure itself. This is a transformation that you can always apply.

[-] expr@programming.dev 7 points 1 day ago

Zalando explicitly forbids it in their RESTful API Guidelines, and I would say their argument is a very good one.

Basically, if you want to provide more fine-grained semantics, use dedicated types for that purpose, rather than hoping every API consumer is going to faithfully adhere to the subtle distinctions you've created.

[-] expr@programming.dev 6 points 1 day ago

Only if using JSON merge patch, and that's the only time it's acceptable. But JSON patch should be preferred over JSON merge patch anyway.

Servers should accept both null and undefined for normal request bodies, and clients should treat both as the same in responses. API designers should not give each bespoke semantics.

[-] expr@programming.dev 2 points 1 day ago

Used in English translations of the Bible, so if you grew up Christian you probably have heard it before.

[-] expr@programming.dev 0 points 1 day ago

Confused what you mean. OpenAPI has nothing to do with JS.

[-] expr@programming.dev 56 points 1 week ago* (last edited 1 week ago)

Glad you got fired. Vaccines should always be mandatory save for legitimate, doctor-validated medical exemptions.

Anti-vaxxers are fucking stupid and should either be educated properly or, if they still refuse to do their civic duty after being de-programmed of misinformation, punished. You are only allowed to participate in society if you take the necessary steps that you are morally and ethically obligated to do in order to protect it from preventable, transmissible disease. We had eradicated polio until stupid motherfuckers like yourself decided that it would be a good idea to forgo the standard polio vaccine schedule that we've had for decades. Now, we saw the first case in 30 years in 2022 because someone selfishly thought that their personal beliefs were more important than the health and livelihood of everyone else.

[-] expr@programming.dev 79 points 3 weeks ago

From what I recall, particularly the younger generations that exclusively use mobile devices (though of course this is not limited to them) actually have terrible tech literacy across the board, primarily related to spending all of their time in apps that basically spoon-feed functionality in a closed ecosystem. In particular, these groups are particularly vulnerable to very basic scams and phishing attacks.

[-] expr@programming.dev 55 points 2 months ago

In case you're not familiar, https://en.m.wikipedia.org/wiki/Grok.

It's somewhat common slang in hacker culture, which of course Elon is shitting all over as usual. It's especially ironic since the meaning of the word roughly means "deep or profound understanding", which their AI has anything but.

[-] expr@programming.dev 55 points 4 months ago

For an adult? Nah. You can certainly kindly let them know that this isn't really gonna work and explain why (and let them know you appreciate the effort), but the rest of it is way overkill and could easily be seen as patronizing, imo. They're an adult, not a 13 year old.

Also, I interpreted the OP as finding it humorously absurd (which it is) rather than being frustrated or anything.

[-] expr@programming.dev 54 points 6 months ago

Thank God. Adobe needs to stay the hell away from Figma.

view more: next ›

expr

joined 1 year ago