2016-10-04 85 views
0
# GET verb version of the "GetClientsForGadget" method from the original ASMX Service 
    /clients/ProspectClient/roleandcstbased/{OrgNmFilter}/{SortNm}?{UserName}: 
    get: 
     tags: 
     - Client 
     summary: Merging of GetClientsforGadget and GetClientsForUser 
     operationId: ClientsForGadgetGET 
     parameters: 
     - name: OrgNmFilter 
      in: path 
      description: Organization Name Filter 
      required: true 
      type: string 
     - name: SortNm 
      in: path 
      description: Sort Field 
      required: true 
      type: string 
     - name: UserName 
      in: query 
      description: User's Identity 
      required: false 
      type: string 
     responses: 
     200: 
      description: Output results for GetClientsForGadget endpoint 
      schema: 
      $ref: '#/definitions/ClientOutput' 

Swagger給了我這個查詢參數沒有有效的參數定義。如果我在路徑和參數定義中刪除對用戶名的所有引用,則不會有任何問題。Swagger查詢不是有效的參數定義嗎?

根據Swagger Specification,我相信我正確使用查詢參數,但不知道它不是。

回答

1

認識到問題出在路徑上。該路徑不需要包含查詢參數。

/clients/ProspectClient/roleandcstbased/{OrgNmFilter}/{SortNm}?{UserName}: 

/clients/ProspectClient/roleandcstbased/{OrgNmFilter}/{SortNm}: 

它只需要在參數中定義查詢。否則錯誤的整個事情。

相關問題