2016-10-04 40 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}: 

它只需要在参数中定义查询。否则错误的整个事情。

相关问题