Skip to content
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

Scripts protoc-swagger-gen and protocgen not working #9293

Closed
4 tasks
skosito opened this issue May 10, 2021 · 3 comments
Closed
4 tasks

Scripts protoc-swagger-gen and protocgen not working #9293

skosito opened this issue May 10, 2021 · 3 comments

Comments

@skosito
Copy link

skosito commented May 10, 2021

Summary of Bug

I would like to generate swagger, but ran into 2 issues:

  • since we need to generate using cosmos sdk scripts, we can use protoc-swagger-gen script, but running this gives following errors:
    google/api/annotations.proto: File not found.
    cosmos/base/query/v1beta1/pagination.proto: File not found.
    blog/query.proto:4:1: Import "google/api/annotations.proto" was not found or had errors.
    blog/query.proto:5:1: Import "cosmos/base/query/v1beta1/pagination.proto" was not found or had errors.

I tried using starport IDE, creating new starport app and trying to run this script (and also protocgen).

If scripts and swagger files are outdated, could you please give me some guidance on how to adapt them?

Version

Last version (starport IDE)

Steps to Reproduce

issue1:
Generate new starport app
Try to execute said scripts there

issue2:
Copy client/docs swagger related files and try to access /swagger


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@tac0turtle
Copy link
Member

This is a starport related issue, @fadeev can you help here

@fadeev
Copy link
Contributor

fadeev commented May 11, 2021

The reason scripts can't access proto files is because proto files are bundled with the Starport binary. This is by design to remove dependencies that users have to install (you wouldn't believe how many people can't install proto or do it wrong).

In v0.16 (scheduled to be released next Monday) we'll be automatically generating swagger (openapi) docs for standard and custom modules on serve and build. Also, v0.16 now only has one dependency: Golang (protoc has been embedded).

@skosito
Copy link
Author

skosito commented May 11, 2021

@fadeev Thanks, looking forward to it!

@skosito skosito closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants