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

在使用openapi生成接口的doc的operationId会有别名 #114

Open
popai9527 opened this issue Jul 30, 2024 · 2 comments
Open

在使用openapi生成接口的doc的operationId会有别名 #114

popai9527 opened this issue Jul 30, 2024 · 2 comments
Assignees

Comments

@popai9527
Copy link

Issue Type

Feature

Have you searched for existing issues?

No

Link to Relevant Documentation

No response

Question Details

在使用openapi生成接口的doc时候,部分接口的operationId字段会有下划线后缀,导致前端在依赖该json生成代码时候导致一些方法名称携带了1或2的名称后缀,这类问题的解决办法是什么样
@zimu-yuxi
Copy link

使用的是什么工具,有可能生成工具检测到有两个操作名为getUsers,它可能会为第二个操作生成一个getUsers_1的operationId。
如果你不希望生成的operationId带有下划线后缀,可以检查生成工具的配置选项,看是否可以自定义operationId的生成规则。如果生成工具没有提供这样的配置选项,你可能需要在生成后手动修改

@popai9527
Copy link
Author

使用的是什么工具,有可能生成工具检测到有两个操作名为getUsers,它可能会为第二个操作生成一个getUsers_1的operationId。 如果你不希望生成的operationId带有下划线后缀,可以检查生成工具的配置选项,看是否可以自定义operationId的生成规则。如果生成工具没有提供这样的配置选项,你可能需要在生成后手动修改

这块使用咱们项目里面配置的 openapi,然后打开了对应的配置,这块咱们原来是有配置的规则吗

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

2 participants