-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Register swagger API #7246
Register swagger API #7246
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7246 +/- ##
==========================================
- Coverage 55.84% 55.82% -0.02%
==========================================
Files 586 586
Lines 35967 35975 +8
==========================================
Hits 20084 20084
- Misses 13914 13922 +8
Partials 1969 1969 |
…_swagger # Conflicts: # client/grpc-gateway/swagger.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
…_swagger # Conflicts: # client/grpc-gateway/swagger.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK! One small point about the names of temp folders created.
Also- is it possible to mark certain API endpoints (e.g. all legacy REST endpoints) as deprecated/soon-to-be-deprecated in Swagger docs?
Looking at the swagger UI it's a bit confusing which endpoints are part of legacy and which ones are the new protobuf ones. (yes I understand that anything with /cosmos
or /ibc
prefixes are proto, but this is not very intuitive for new developers.
|
||
# clean swagger files | ||
find ./ -name 'query.swagger.json' -exec rm {} \; | ||
rm -rf cosmos | ||
rm -rf ibc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we output these to a default root directory other than ./
?
As it is now, this would cause problems if in the future we add a ./ibc
or ./cosmos
directory for any purpose besides these swagger auto generated files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also- is it possible to mark certain API endpoints (e.g. all legacy REST endpoints) as deprecated/soon-to-be-deprecated in Swagger docs?
Yes 100%, I'll address this in a followup PR
Can we output these to a default root directory other than
./
?As it is now, this would cause problems if in the future we add a
./ibc
or./cosmos
directory for any purpose besides these swagger auto generated files.
Correct, but we don't have custom output directory support for protoc-sawgger-gen
. I have created an issue upstream to add support for that. For now,
- We can revert this to remove all generated files (
find ./ -name 'query.swagger.json' -exec rm {} \;
) first and then remove./cosmos
,./ibc
directories if they are empty. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! how do I deploy the swagger docs locally? |
you can access it via |
Is that documented somewhere? If not, can we add it as a todo item for the v0.40 docs? |
* init * Fix statik gen * Fix swagger * Change swagger url * Fix swagger serve * remove ibc swagger from legacy docs * Add old routes config * Move swagger api to app.go * add godoc * Fix inputs * Fix swagger dir * Fix statik * refactor * fmt * fix doc * Fix swagger config check
* init * Fix statik gen * Fix swagger * Change swagger url * Fix swagger serve * remove ibc swagger from legacy docs * Add old routes config * Move swagger api to app.go * add godoc * Fix inputs * Fix swagger dir * Fix statik * refactor * fmt * fix doc * Fix swagger config check
Description
client/grpc-gateway
toclient/docs
x/ibc
docs from old swaggerapp.go
, this allows other applications to override/customize swagger API easilyBefore we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes