-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make re-usable helper method for RegisterSwaggerAPI #12149
Comments
Sounds reasonable to me! |
Hi, can I pick this up? It would be helpful if you can point me to the files I need to look at. |
Yes please and thank you @deepto98! |
@alexanderbez I'm done with the code changes, but I'm getting an error while running
Can you please help me build the project on my local (can't find the exact steps in the doc) and sort this issue? |
Okay, sure. Thanks for letting me know. |
@alexanderbez I've tried to add the changes in #12352. Do let me know if this looks okay |
Summary
Every SDK app has several lines dedicated to Registering a swagger API, that basically look identical. It would be great if we can just make a default function in baseapp, or server in the SDK, that apps can call unless they need further customization.
Each application I've looked at basically has the lines:
where api and config are
respectively.
The RegisterSwaggerAPI is basically the same across many apps. I don't understand why Osmosis does something different tbh, probably something that can be generically handled or we can adapt.
Gaia RegisterSwaggerAPI
Osmosis RegisterSwaggerAPI
Akash RegisterSwaggerAPI
This all seems within the bounds of something we can just call a function in server for! (Would appreciate if anyone figures out whats happening in osmosis' wrt
static
. Is that re-usable, something that should be a config option, or should it be deleted)Problem Definition
Eliminate another ~15 lines from every SDK app package, that is noise to most applications.
Proposal
Make a common function, that encompasses the
if swagger.Enabled { do default swagger init logic }
.For Admin Use
The text was updated successfully, but these errors were encountered: