知识卡片
OpenAPI地址随环境配置
OpenAPI 的 servers 列表声明客户端和文档页面应请求的基础地址。部署到负载均衡器后,若仍指向本地地址,交互文档可能把请求发错目标;更新外部地址时应核对协议、域名与环境,避免误把测试端点当生产端点。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Microservice APIs》第 14 章《Deploying microservice APIs with Kubernetes》(源文件:_epub-src/OEBPS/Text/14.htm)
- 结论依据:原文将 ALB 主机名加入 OpenAPI servers 后重建部署,说明规范中的地址会影响交互入口。
- 原始内容:To use the Swagger UI in our deployment, we need to update the API specification with the hostname of our Kubernetes cluster’s ALB. In this section, we update the order’s API specification, make a new deployment, and test it.