Configure Spring Boot with Swagger to generate documentation from a json

Asked

Viewed 867 times

0

Good morning, everyone.

I’m documenting a project’s Apis using Swagger2.

In this documentation instead of using annotations a json file is used. I wonder if it is possible to create a Spring Boot project with Swagger 2, which uses json to document the Apis.

I searched the internet and only found this tutorial: https://dzone.com/articles/overcoming-swagger-annotation-overload-by-switchin?utm_content=bufferc0957&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

I followed the steps described, but it didn’t work.

The only way I could was by downloading the dist folder from the project https://github.com/swagger-api/swagger-ui/tree/master/dist and pointing to the json, but does Spring Boot not have a way to set up for it to read the json?

1 answer

0

There are two ways you can work in this situation.

API First: You have the contract designed first and want to create a project scaffolding for Spring Boot. For this use Swagger codegen.

Develop first: if you develop the API and then want to create a contract for it the framework Springfox can help you in this situation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.