Swagger 招摇过市模式不适用于招摇过市UI
我正在用swagger制作一个API,并试图更新YAML,以便将regex模式需求添加到参数中。目前,我正在尝试以下方法:Swagger 招摇过市模式不适用于招摇过市UI,swagger,swagger-ui,swagger-2.0,swagger-editor,Swagger,Swagger Ui,Swagger 2.0,Swagger Editor,我正在用swagger制作一个API,并试图更新YAML,以便将regex模式需求添加到参数中。目前,我正在尝试以下方法: # getCPIStatesForCountry endpoint /getCPIStatesForCountry: # This is a HTTP operation get: # Describe this verb here. Note: you can use markdown description: |
# 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允许我输入任何内容作为有效输入。为什么会这样 Swagger UI 3.4.3及更高版本支持对模式进行参数验证