@@ -55,21 +55,21 @@ proc deletePet*(httpClient: HttpClient, petId: int64, apiKey: string): Response
5555
5656proc findPetsByStatus * (httpClient: HttpClient , status: seq [Status ]): (Option [seq [Pet ]], Response ) =
5757 # # Finds Pets by status
58- let query_for_api_call = encodeQuery ([
58+ let url_encoded_query_params = encodeQuery ([
5959 (" status" , $ status.join (" ," )), # Status values that need to be considered for filter
6060 ])
6161
62- let response = httpClient.get (basepath & " /pet/findByStatus" & " ?" & query_for_api_call )
62+ let response = httpClient.get (basepath & " /pet/findByStatus" & " ?" & url_encoded_query_params )
6363 constructResult [seq [Pet ]](response)
6464
6565
6666proc findPetsByTags * (httpClient: HttpClient , tags: seq [string ]): (Option [seq [Pet ]], Response ) {.deprecated .} =
6767 # # Finds Pets by tags
68- let query_for_api_call = encodeQuery ([
68+ let url_encoded_query_params = encodeQuery ([
6969 (" tags" , $ tags.join (" ," )), # Tags to filter by
7070 ])
7171
72- let response = httpClient.get (basepath & " /pet/findByTags" & " ?" & query_for_api_call )
72+ let response = httpClient.get (basepath & " /pet/findByTags" & " ?" & url_encoded_query_params )
7373 constructResult [seq [Pet ]](response)
7474
7575
@@ -91,21 +91,21 @@ proc updatePet*(httpClient: HttpClient, pet: Pet): (Option[Pet], Response) =
9191proc updatePetWithForm * (httpClient: HttpClient , petId: int64 , name: string , status: string ): Response =
9292 # # Updates a pet in the store with form data
9393 httpClient.headers[" Content-Type" ] = " application/x-www-form-urlencoded"
94- let query_for_api_call = encodeQuery ([
94+ let form_data = encodeQuery ([
9595 (" name" , $ name), # Updated name of the pet
9696 (" status" , $ status), # Updated status of the pet
9797 ])
98- httpClient.post (basepath & fmt" /pet/{ petId} " , $ query_for_api_call )
98+ httpClient.post (basepath & fmt" /pet/{ petId} " , $ form_data )
9999
100100
101101proc uploadFile * (httpClient: HttpClient , petId: int64 , additionalMetadata: string , file: string ): (Option [ApiResponse ], Response ) =
102102 # # uploads an image
103103 httpClient.headers[" Content-Type" ] = " multipart/form-data"
104- let query_for_api_call = newMultipartData ({
104+ let multipart_data = newMultipartData ({
105105 " additionalMetadata" : $ additionalMetadata, # Additional data to pass to server
106106 " file" : $ file, # file to upload
107107 })
108108
109- let response = httpClient.post (basepath & fmt" /pet/{ petId} /uploadImage " , multipart= query_for_api_call )
109+ let response = httpClient.post (basepath & fmt" /pet/{ petId} /uploadImage " , multipart= multipart_data )
110110 constructResult [ApiResponse ](response)
111111
0 commit comments