CLOVIS
10/23/2026, 12:45 PM200 Ok and sometimes a 204 No Content , or similar. If you do, I'm interested in discussing your use-case (it impacts a design decision for spine.opensavvy.dev).
(The case where an endpoint "is either successful OR fails with one of multiple error codes" is already handled)dave
10/23/2026, 12:51 PMCLOVIS
10/23/2026, 12:58 PMdave
10/23/2026, 12:58 PMhfhbd
10/23/2026, 1:01 PMCLOVIS
10/23/2026, 1:02 PMhfhbd
10/23/2026, 1:03 PMCLOVIS
10/23/2026, 1:04 PMCLOVIS
10/23/2026, 1:05 PMdave
10/23/2026, 1:07 PMDo you have an example of such a use-case?For 200 Vs 202 on an update, you're trying to convey that the difference between work done and work queued. It can have a semantic difference on how the client behaves
hfhbd
10/23/2026, 1:07 PMdave
10/23/2026, 1:07 PMhfhbd
10/23/2026, 1:08 PMCLOVIS
10/23/2026, 1:09 PMFor 200 Vs 202 on an update, you're trying to convey that the difference between work done and work queued.Do you have such an endpoint in an API that uses both? I know that's theoretically possible, but I've never seen an API that sometimes enqueues and sometimes does immediately
hfhbd
10/23/2026, 1:09 PMCLOVIS
10/23/2026, 1:10 PMI'd lean towards a sealed result type which conveys the 2 cases using the type systemDoes the client switch on the result type (after deserialization of the body), or do they switch on the status code itself (before deserialization of the body)?
hfhbd
10/23/2026, 1:10 PMdave
10/23/2026, 1:11 PMCLOVIS
10/23/2026, 1:11 PMAnd we have an internal api that returns 204 in case of no results when doing a search.That's the kind of examples I'm searching for, thanks
dave
10/23/2026, 1:12 PMhfhbd
10/23/2026, 1:13 PMCLOVIS
10/23/2026, 1:16 PMPreviously we'd detect the response type and then convert to the sealed type (with body) on that basis.Do you have an example where the DTO is completely different depending on the status code (ignoring error status codes), and your serialization library would not be able to deserialize the general case? As a counter-example: if the DTO includes a
type: foo discriminator that is redundant with the status code, the deserialization library can it use to switch on even if the status code is unknowndave
10/23/2026, 1:19 PMdave
10/23/2026, 1:20 PMCLOVIS
10/23/2026, 1:23 PMIt seems to be popular with the AI providers where the shapes can be totally different without a type fieldCan you give me a specific example? A link to their documentation would be perfect
dave
10/23/2026, 1:26 PMRonaldo Pace
10/23/2026, 1:34 PMCLOVIS
10/23/2026, 1:39 PMTight ktor-server-client connetion is a topic I'm very interested.Please read spine.opensavvy.dev, that's exactly what I'm doing ๐
hfhbd
10/23/2026, 1:39 PMRonaldo Pace
10/23/2026, 1:39 PMgetUsers: suspend () -> Result<GetUsersResponse>. So it hides the HTTP parts away and simplifies a lot unit testing, hence it either success of an expcetion for Controller/ViewModelCLOVIS
10/23/2026, 1:39 PMCLOVIS
10/23/2026, 1:41 PMIn code it looks something likeYeah, all fullstack projects I've seen so far don't bother with the status code at all, and just use sealed hierarchies inside the response body to represent the different cases. That's trivially supported by any framework, but I'm interested in the more complex use-cases, since they are theoretically possible in the spec. So it hides the HTTP parts away and simplifies a lot unit testing, hence it either success of an expcetion for Controller/ViewModelgetUsers: suspend () -> Result<GetUsersResponse>
CLOVIS
10/23/2026, 1:43 PMRonaldo Pace
10/23/2026, 1:43 PMtrivially supported by any frameworknot supported on the openApi generator thingy =/
but I'm interested in the more complex use-cases, since they are theoretically possible in the specdefinitely, from a library perspective makes total sense.
that's exactly what I'm doingI guess that's exactly what we are all doing ๐ github.com/budius/kebab-krafter, but I went with the Swagger -> Code generator approach
hfhbd
10/23/2026, 1:45 PMtrivially supported by any framework
not supported on the openApi generator thingy =/Why not? It is really trivial.
Ronaldo Pace
10/23/2026, 1:46 PMRonaldo Pace
10/23/2026, 1:47 PMhfhbd
10/23/2026, 1:50 PMdave
10/23/2026, 1:50 PMRonaldo Pace
10/23/2026, 1:52 PManyOf/oneOf is challenging yes... and ultimately led me to develop the link I sent, but I agree it was hard to map anyOf/oneOf to sealed classes.
Amir Golmoradi
10/23/2026, 1:53 PMPUT returning 201 on create, 200 on update) and idempotent `POST`s (201 first time, 200 on replay with the same key). Also conditional GETs (200 vs 304) and async endpoints that return 202 when queued but 200 if they finished inline. In all of these the status code tells the client something the body doesnโt, so itโd be nice if Spine could model them as different success variants.hfhbd
10/23/2026, 1:55 PMDanielZ
10/23/2026, 1:57 PMCLOVIS
10/23/2026, 3:00 PMIn all of these the status code tells the client something the body doesnโt, so itโd be nice if Spine could model them as different success variants.What does the client do differently based on this information? Or is it just used for debugging?
CLOVIS
10/23/2026, 3:06 PMLike we have some data and the calculation based on them deliver 204, 200 or 404.Can you give a specific example and explain what you're doing different based on the status code?
Michal Wachowski
10/23/2026, 9:17 PMCLOVIS
10/25/2026, 11:39 AM