Is there an easy description on how to write a sma...
# ktor
h
Is there an easy description on how to write a small pre/post request interceptor for Ktor? It doesn't seem very popular to do that but we have some custom validation we would like to apply across the board so that seems like the proper way to do it. Any hints or ideas on this?
a
Can you please describe what exactly do you need to validate?
h
Payload structure. We are planning to use jakarta.validation (it's not javax anymore it seems...). Currently we are using
ApplicationCall.parseRequest()
for this. It seems to work but I was curious if there is some more standard way to do this in ktor
a
You can validate the request body structure by using the RequestValidation plugin (https://ktor.io/docs/request-validation.html).
h
How did I miss this one... Does it still work if we use our extension above I wonder..... Thx!