Swagger- Schemes HTTP and HTTPS with different ports

你说的曾经没有我的故事 提交于 2019-12-04 05:09:11

问题


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:


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'


来源:https://stackoverflow.com/questions/48303541/swagger-schemes-http-and-https-with-different-ports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!