Swagger documentation should automatically be registered if api.swagger setting in app.toml is enabled
swagger = true
It was broken though, as this configuration was ignored in the app. Simply adding route would not work either. As just enabling it would pull swagger that is generated in sei-cosmos only lacking some modules APIs.
Below solution adds similar capability to sei-chain level and is tweaked to involve ignite generated swagger API docs.
This change:
adds swagger route (if configured)
updates the path openapi/swagger yml is generated
adds swagger-ui template
introduces similar way of serving docs (with statik lib) to that of cosmos sdk (note, that we are not reusing the same scripts though, as in this repo we use ignite for openapi/swagger docs generation.
Describe your changes and provide context
Swagger documentation should automatically be registered if
api.swagger
setting inapp.toml
is enabledIt was broken though, as this configuration was ignored in the app. Simply adding route would not work either. As just enabling it would pull swagger that is generated in
sei-cosmos
only lacking some modules APIs. Below solution adds similar capability tosei-chain
level and is tweaked to involveignite
generated swagger API docs.This change:
statik
lib) to that of cosmos sdk (note, that we are not reusing the same scripts though, as in this repo we useignite
for openapi/swagger docs generation.Testing performed to validate your change