Hello, is there an idiomatic way of handling http ...
# ktor
p
Hello, is there an idiomatic way of handling http patch requests in Kotlin(Ktor, etc)?
a
Can you describe your problem in more detail, preferably with a code snippet?
p
I don’t have a code snippet handy at this moment. I’ll share one later. The core of my questions is about how to translate a Patch request into strongly typed (data) classes. In particular, I wonder if there is a Kotlin/Ktor idiomatic way to distinguish between a field being set to null vs a field being removed from the document referenced in a the Patch request.
One way to deal with this is to use a request format such JSON Patch. https://en.m.wikipedia.org/wiki/JSON_Patch
I wonder if there is some well know practice/pattern in Ktor or if there are Kotlin libraries to deal with the ambiguity mentioned above or is everyone just rolling their own custom solutions.
Let me know if my question makes sense, thank you!