Я делаю API с swagger и пытаюсь обновить YAML, чтобы добавить к параметрам требования к шаблону регулярного выражения. В настоящее время я пытаюсь сделать следующее:
# 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 позволяет мне вводить что угодно в качестве действительного ввода. Почему это?