https://kotlinlang.org logo
Title
n

Nezteb

04/25/2019, 10:49 PM
I’m serving this swagger folder via
static
. If I go to the static path
/swagger.json
, i see the pictured
swagger.json
file. If I go to
/swagger.yaml
though, I get a 404. I noticed
static
has an overload with a second argument called
extraPairs: Pair<String, ContentType>
. do I have to use that second arg?
Aha! I just guessed at how it worked and was right:
"/static" bind static(ResourceLoader.Classpath("public/swagger"), Pair("yaml", ContentType.TEXT_PLAIN))
👍 1
Fyi, I've renamed that arg now in the source to be a bit more obvious
ExtraPairs is a bit rubbish