You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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).
Summary of Bug
I would like to generate swagger, but ran into 2 issues:
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).
The resource from “http://localhost:1317/swagger-ui.css” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
swagger
The resource from “http://localhost:1317/swagger-ui-bundle.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
swagger
The resource from “http://localhost:1317/swagger-ui-standalone-preset.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
swagger
Loading failed for the <script> with source “http://localhost:1317/swagger-ui-bundle.js”. swagger:36:1
Loading failed for the <script> with source “http://localhost:1317/swagger-ui-standalone-preset.js”. swagger:37:1
The resource from “http://localhost:1317/swagger-ui-standalone-preset.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
swagger
Uncaught ReferenceError: SwaggerUIBundle is not defined
onload http://localhost:1317/swagger:42
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
The text was updated successfully, but these errors were encountered: