Fork me on GitHub
#reitit
<
2023-03-03
>
danielneal14:03:13

I have a setup where the presence of a key in the request changes the spec of the response, I’m wondering what the most expressive way of configuring reitit is to support this.

opqdonut14:03:23

I think you just need to have a response schema that allows both formats

opqdonut14:03:37

when I've had APIs like that, I've ended up splitting into different endpoints

opqdonut14:03:09

e.g. one endpoint per command instead of one command endpoint that accepts a :command :frobnulate parameter

opqdonut14:03:23

because that allows for better swagger docs, basically

opqdonut14:03:29

and better coercion error messages

danielneal14:03:45

yeah, that makes sense, thanks!