[-] [email protected] 22 points 22 hours ago* (last edited 22 hours ago)

It has the return type declared to be double.

[-] [email protected] 14 points 2 days ago

Every day pretty much with Unix tools. Vim, awk, sed, etc.

[-] [email protected] 1 points 4 days ago

That's what the If-Match header is for. It prevents this problem.

That being said, I generally think PUTs are preferable to PATCHes for simplicity.

[-] [email protected] 2 points 5 days 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.

[-] [email protected] -1 points 5 days 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).

[-] [email protected] 0 points 5 days 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.

[-] [email protected] 7 points 6 days 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.

[-] [email protected] 5 points 6 days 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.

[-] [email protected] 2 points 6 days ago

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

[-] [email protected] 0 points 6 days ago

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

[-] [email protected] 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.

[-] [email protected] 84 points 2 months ago

I just found out about this debate and it's patently absurd. The ISO 80000-2 standard defines ℕ as including 0 and it's foundational in basically all of mathematics and computer science. Excluding 0 is a fringe position and shouldn't be taken seriously.

view more: next ›

expr

joined 1 year ago