我可以使用多臺主機,如:在Swagger中,我該如何指定多個主機?
host1: petstore.test.com
host2: petstore1.test.com
host3: petstore2.dev.com
現在我YAML文件只有一個主機URL。
例如:
host: petstore.test.com
basePath:/
我可以使用多臺主機,如:在Swagger中,我該如何指定多個主機?
host1: petstore.test.com
host2: petstore1.test.com
host3: petstore2.dev.com
現在我YAML文件只有一個主機URL。
例如:
host: petstore.test.com
basePath:/
的OpenAPI /揚鞭2.0僅支持具有多個方案的單個主機(HTTP/HTTPS /等),這樣可以有效地具有兩個主機,只有在方案有所不同:
host: petstore.test.com
schemes:
- http
- https
最新版本,OpenAPI 3.0,支持multiple hosts:
servers:
- url: https://petstore.prd.com
description: Production server
- url: {scheme}://petstore.dev.com
description: Development server
templates:
scheme:
enum:
- http
- https
default: https
YAML沒有主機的概念 – Anthon