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

Swagger doesn't work with multiple proto files #378

Closed
b00f opened this issue Sep 5, 2022 · 6 comments · Fixed by #687
Closed

Swagger doesn't work with multiple proto files #378

b00f opened this issue Sep 5, 2022 · 6 comments · Fixed by #687
Assignees
Labels
bug Something isn't working www

Comments

@b00f
Copy link
Collaborator

b00f commented Sep 5, 2022

Description

After splitting proto files, swagger doesn't work and user should enter proto files manually to check the APIs.

How To Reproduce

Compile the latest code and check swagger.

What Happened

This error shows: Failed to load API definition.

Workaround

Changing proto file in Swagger and then click "Explore".

@b00f b00f added bug Something isn't working www labels Sep 5, 2022
@Ja7ad
Copy link
Contributor

Ja7ad commented Jun 15, 2023

@b00f We can use trascoding standard of google API design guide.

In grpc gateway openapiv2 generators have opt allow_merge for merge swaggers.

protoc --proto_path=proto --openapiv2_out=allow_merge=true:api --openapiv2_opt use_go_templates=true proto/*.proto

@b00f
Copy link
Collaborator Author

b00f commented Jun 16, 2023

@Ja7ad
I wasn't aware of that. It seems like a good solution. Let's give it a try.

@Ja7ad
Copy link
Contributor

Ja7ad commented Jun 16, 2023

@Ja7ad I wasn't aware of that. It seems like a good solution. Let's give it a try.

This required to update all proto to support transcoding option for methods.
I do it.

@Ja7ad
Copy link
Contributor

Ja7ad commented Jun 16, 2023

@b00f please assign to me dudu :)

@b00f
Copy link
Collaborator Author

b00f commented Sep 10, 2023

@Ja7ad Did you find any solution for this issue?

@Ja7ad
Copy link
Contributor

Ja7ad commented Sep 10, 2023

@Ja7ad Did you find any solution for this issue?

I use grpc gateway production ready for transcoding, support merge swagger and work it.

I do refactoring to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working www
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants