How to validate/receive MultiPartData in a type-sa...
# ktor
m
How to validate/receive MultiPartData in a type-safe way?
Copy code
validate<MultiPartData> { request ->
    // perform validation
}
If I do this, then all MultiPartData will be validated in the same way. I’m looking for something like:
Copy code
call.receiveMultipart<MyCustomMultiPartData>()
I tried implementing the MultiPartData interface, but not sure how to implement the readPart() method. Also
call.receive<MyCustomMultiPartData>()
will not receive as multipart
a
Unfortunately, that's impossible using the
RequestValidation
plugin. You can manually validate the parts while reading them up.
1