Closed mackoj closed 3 years ago
@mackoj Not sure if you're still looking for a cleaner solution, but I ran into this issue as well and after some digging I learned that we need to set the Alamofire URL encoding to use .literal for boolean encoding: https://github.com/Alamofire/Alamofire/issues/1056#issuecomment-411123543
I fixed it on line is 231 in Templates/Swift/Sources/APIClient:
urlRequest = try URLEncoding(destination: .queryString, boolEncoding: .literal).encode(urlRequest, with: queryParams)
Thanks I will replace my ugly fix
Hi @yonaskolb,
When I send request with query parameter some web-services uses "true"/"false" instead of "0"/"1" for boolean. The way SwagGen works today it's only sending "0"/"1".
In order to fix it I did make this modifications but I find them ugly at best. How can I fix this problem in a better way ?
Templates/Swift/Sources/APIClient.swift(line A10)
Templates/Swift/Sources/Request.swift(line 95)
Thanks,