2017-04-19 5 views
0

swagger로 API를 만들고 있는데 YAML을 업데이트하여 정규식 패턴 요구 사항을 매개 변수에 추가하려고합니다. 현재 다음을 시도하고 있습니다.Swagger UI에서 Swagger 패턴이 작동하지 않습니다.

# 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에서는 유효한 입력으로 아무 것도 입력 할 수 없습니다. 왜 이런거야?

답변

1

버전 3.0.6에서 Swagger UI는 pattern에 대한 입력 유효성 검사를 지원하지 않습니다. 모델 등록 정보의 설명에 pattern 만 표시하지만 기본 매개 변수에는 사용하지 않습니다.

기능 요청을 제출하거나 당기기 요청 on GitHub을 제출할 수 있습니다.

관련 문제