softwaremill / tapir

Rapid development of self-documenting APIs
https://tapir.softwaremill.com
Apache License 2.0
1.36k stars 411 forks source link

Incorrect default yaml name SwaggerAkka - scala 2.13 #178

Closed davidnadeau closed 5 years ago

davidnadeau commented 5 years ago

The examples using SwaggerAkka fail to run on scala 2.13 tapir 0.9.0 because of this line: https://github.com/softwaremill/tapir/blob/master/docs/swagger-ui-akka-http/src/main/scala/tapir/swagger/akkahttp/SwaggerAkka.scala#L17

The default yaml file name is actually docs.yml, however this file sets it as docs.yaml. This was confusing to resolve as a first time tapir user.

adamw commented 5 years ago

Sorry for the trouble! In what sense is docs.yml the default? Is it defined somewhere? I couldn't find references to docs.yml anywhere in tapir's source code.

davidnadeau commented 5 years ago

I cannot find it either. If i run this hello world, i get the following error:

Failed to load API definition
Fetch error
Not Found /docs/docs.yml

The url is being rewritten to http://localhost:8080/docs/index.html?url=/docs/docs.yml. I use firefox as my browser, and tried it in chrome, it gets rewritten correctly to http://localhost:8080/docs/index.html?url=/docs/docs.yaml.

Something to do with firefox vs chrome?

adamw commented 5 years ago

Hm works fine for me both using firefox and chrome. Maybe you have the old address cached in favorites? I think I did change the yaml file name from docs.yml to docs.yaml as various examples used various variants. So maybe that's the cause?

davidnadeau commented 5 years ago

Ya it was cached, worked in firefox incognito as expected. Thank you