【问题标题】:Swagger- Schemes HTTP and HTTPS with different portsSwagger- 使用不同端口的方案 HTTP 和 HTTPS
【发布时间】:2018-01-17 14:32:12
【问题描述】:

如何指定具有不同端口的多个模式?具体来说,我想在端口 81 上使用 HTTP,在端口 444 上使用 HTTPS。

swagger: '2.0'
info:
  version: 1.0.0
  title: API for gateways
  description: API for gateways to access server (port 81 for http and 444 for https)
schemes:
  - http
  - https
host: gateway.example.com:81
basePath: /1.0
paths:

【问题讨论】:

标签: rest swagger swagger-2.0


【解决方案1】:

这在 OpenAPI 3.0 中是可能的,但在 OpenAPI/Swagger 2.0 中是不可能的。

openapi: 3.0.0
servers:
  - url: 'http://gateway.example.com:81'
  - url: 'https://gateway.example.com:444'

【讨论】:

  • 如果部署在 EKS 中,我需要使用动态 URL。有什么方法可以实现吗?
猜你喜欢
  • 1970-01-01
  • 2014-04-22
  • 2017-06-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-11
相关资源
最近更新 更多