-
Notifications
You must be signed in to change notification settings - Fork 57
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
一个进程启动grpc和gin时的swagger页面访问问题 #106
Comments
@careyyoung Hi, I will look at this problem~ |
@careyyoung rk-boot 默认会从 api/gen/v1 和 docs/ 文件夹搜寻 swagger config 配置文件。在这个 Case 当中,Gin swagger UI 没有成功加载 Swagger Config 文件,可能是因为 swagger config 文件路径没找到,或者它从 proto 文件生成的时候,出现了一些兼容性问题(不过这种情况几乎不会出现)。 此外,TLS 错误这个问题,应该不是 rk-boot 的配置问题,因为你的 boot.yaml 里没有涉及到 TLS 相关配置。 我的猜想,应该是 swagger config 文件没有成功加载正确的配置文件。 我这里创建了一个例子,同时启动 Gin & gRPC,可以参考一下。 另外,可以尝试一下在 boot.yaml 中,通过 sw.jsonPath 来指定 Swagger Config 文件所在的文件夹,来 Debug 是否依然不能成功加载。 举例: grpc:
- name: grpc-api
enabled: true
port: 8080
enableReflection: true
sw:
enabled: true
# define swagger config file path if we hope to use different one
# jsonPath: ""
gin:
- name: rest-api
port: 8081
enabled: true
sw:
enabled: true
# define swagger config file path if we hope to use different one
# jsonPath: "" |
@careyyoung Hi,上面的问题解决了吗?如果没有解决,请继续留下错误码和相关信息。 |
Describe the bug
你好,
计划,一个boot.yaml,启动两个服务:grpc 和 gin,不同的 entryName
现在能启动,能通过不同的端口访问到 grpc 和 gin 的服务
但是,访问 sw 时,
只能 grpc 的 sw 正常,gin 的 sw 会提示:Failed to load API definition.
在控制台还会看到日志:2022/05/18 18:19:05 http: TLS handshake error from [::1]:12819: remote error: tls: unknown certificate
不过,访问 自定义的和common service 的路由 都是能正常访问的。
配置如下:
Additional context
rk-boot/v2 v2.1.2
rk-entry/v2 v2.1.7
rk-gin/v2 v2.1.2
rk-grpc/v2 v2.1.6
谢谢。
The text was updated successfully, but these errors were encountered: