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

使用openapiv2,出现protoc-gen-openapiv2/options/annotations.proto: File not found. #3156

Closed
swurtheone opened this issue Jan 16, 2024 · 3 comments
Labels
question Further information is requested

Comments

@swurtheone
Copy link

kratos目前仅支持openapiv2,但是按照官方示例,出现以下问题:
api目录中的proto文件
image

third_part已添加protoc-gen-openapiv2
image

执行kratos proto client message.proto

image

@swurtheone swurtheone added the question Further information is requested label Jan 16, 2024
@kratos-ci-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Kratos currently only supports openapiv2, but according to the official example, the following problems occur:
proto file in the api directory
image

third_part has added protoc-gen-openapiv2
image

Execute kratos proto client message.proto

image

@kvii
Copy link
Contributor

kvii commented Feb 3, 2024

看你执行 kratos proto client 的方法,你应该是没有在工程根目录执行命令。我尝试着按你图中的方式搭了个工程,果然复现出了相同的报错。

问题解决方式也很简单,在工程根目录执行命令就行了。也可以直接在工程根目录执行 make api 生成代码。工程链接 在这里。

另外说一句,如果您能在提交 issue 的时候像这样给出一个最小复现的工程的话,也会减少别人复现和定位问题的时间。如果这个问题您已经解决了的话,也希望您能及时关闭这个 issue。这样也不会让别人白费力气。

@kratos-ci-bot
Copy link
Collaborator

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Judging from the way you execute kratos proto client, you should not execute the command in the project root directory. I tried to build a project according to the method in your picture, and sure enough the same error occurred.

The solution to the problem is also very simple, just execute the command in the project root directory. You can also execute make api directly in the project root directory to generate code. Project link is here.

In addition, if you can provide a minimally reproducible project like this when submitting an issue, it will also reduce the time for others to reproduce and locate the problem. If you have solved this problem, I hope you can close this issue in time. This will not let others waste their efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants