Hey guys! I've been having issues setting up swagg...
# ktor
m
Hey guys! I've been having issues setting up swagger UI for my project. I have the dependency listed, and paths set, but for some reasons, I keep getting an error "Failed to load API definition". You can find screenshots of my setup
j
Try to move the spec file into your resources folder otherwise its not part of the JAR.
👍 1
m
I did move it to resources/static/documentation.yaml but still facing same issue.
j
image.png
a
Why is there a double forward slash in your URL?
m
@Jonas TM I just moved the documentation file to the resources folder but I'm still faced with the same error
@Arjan van Wieringen I'm not sure about that
It's probably coming from this:
I just noticed that when I change the url in the explore input field to use one forward slash, it works. Now how do I change the url to use one forward slash by default?
Screenshot_2023-03-17_19-09-08.jpg
So I finally found a way to solve this. For those interested in knowing how, I basically recreated the index.html file for swagger-ui, after noticing the default had the url set with double forward slash in its config. You can find screenshot of the default attached
Here's my recreated (using single forward slash) index.html and some exposed routes to serve the specification and index.html file.