I feel like I'm missing something simple, but none of my searches have gotten me the answer I was hoping/looking for.
Problem Statement
I'm writing a Spring Boot application which exposes a bunch of RESTful API's. For various reasons I have a YAML file that contains the API documentation (written in OpenAPI 3.0). I'm looking for an easy (it's Spring Boot after all) way to show that document.
What I've done
Spent more then 3 hours reading various posts, watching youtube vids that talk about Springfox's swagger and swagger-ui (amongst other things)
This generates the documentation 'on the fly', I want to display the YAML file
I've seen a couple of posts that discuss downloading the swagger-ui github repo, unzip it and modify the index.html to point at my YAML file instead of the default it has.
While this is doable, it requires me to manual download, update files and repackage them (not a huge issue but seems more then I would expect)
Solution being looked for
Ideally I was hoping there was a Maven plugin that I could setup and pass a config option to, telling it where the YAML file is located and it would simply display it
Thanks in advance
You can serve the file as a static resource, either by adding it to one of the spring boot default static resources locations (src/main/resources/META-INF/resources, src/main/resources/resources, src/main/resources/static, src/main/resources/public) or by overriding default locations and add your custom path where your open-api yaml file is located (set spring.resources.static-locations property).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With