Swagger- Schemes HTTP and HTTPS with different por

2019-03-01 07:31发布

How does one specify multiple schema with different ports? Specifically, I want to have HTTP on port 81 and HTTPS on port 444.

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:

1条回答
劫难
2楼-- · 2019-03-01 07:52

This is possible in OpenAPI 3.0, but not in OpenAPI/Swagger 2.0.

openapi: 3.0.0
servers:
  - url: 'http://gateway.example.com:81'
  - url: 'https://gateway.example.com:444'
查看更多
登录 后发表回答