0
我正在使用swagger創建一個API,並試圖更新YAML以將正則表達式模式要求添加到參數中。目前我正在嘗試以下操作:Swagger模式不能與Swagger UI一起工作
# getCPIStatesForCountry endpoint
/getCPIStatesForCountry:
# This is a HTTP operation
get:
# Describe this verb here. Note: you can use markdown
description: |
Returns a list of states for a given country
produces:
- application/json
# This is array of GET operation parameters:
parameters:
-
name: country_code
in: query
description: Code of desired country
required: true
type: string
pattern: "^[a-zA-Z]+$"
但是,Swagger UI讓我輸入任何內容作爲有效輸入。爲什麼是這樣?