2017-04-19 18 views
0

swaggerでAPIを作成していますが、YAMLを更新して正規表現のパターン要件をパラメーターに追加しようとしています。現在、私は以下を試しています: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]+$" 

しかし、スワッガーUIは有効な入力として何かを入力させています。どうしてこれなの?

答えて

1

バージョン3.0.6以降、Swagger UIはpatternに対して入力検証をサポートしていません。モデルプロパティの説明にはpatternが表示されますが、プリミティブパラメータには使用されません。

フィーチャーリクエストを送信できます(またはプルリクエストを送信できます)on GitHub

関連する問題