1

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:
user1032531
  • 24,767
  • 68
  • 217
  • 387
  • Related: [In Swagger, how do I specify multiple hosts?](https://stackoverflow.com/q/40583604/113116) – Helen Jan 17 '18 at 16:22

1 Answers1

0

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'
Helen
  • 87,344
  • 17
  • 243
  • 314