-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Swift3] primitive typed parameters in POST body #5500
Comments
@TeMob can you give an example of the HTTP body? we want to know the request body looks like. |
I can't get it to produce a request, so I can't show you the HTTP-request it sends. |
@TeMob I'm not referring to the HTTP request produced by the Swift3 API client. I want to take a look at the correct HTTP request body to understand what payload is expected by the RESTful backend. |
@wing328 I have the same problem. The codegen are trying to parse every body parameter to JSON, even when in swagger editor I put Expected request:
|
@jahertor thanks for sharing more with an example. I think the issue is that Swift3 only supports JSON payload (body parameter) at the moment. Would you have you time to contribute the enhancements? I can show you some good starting points. |
Description
Hi
I am struggling with primitive parameters used in the request body of POST requests.
The problem is that primitive parametertypes, such as "string", are forced to be JSON encoded, because all body-parameters are being JSON encoded.
Thats part of the problem. Another problem is that all parameters are being casted to a [String:AnyObject] dictionary, although a plain string will never succeed in doing so.
This is the code that swagger-codegen generated:
Swagger-codegen version
2.2.2
Swagger declaration file content or url
Command line used for generation
java -jar swagger-codegen-cli.jar generate -i /path/to/my.yaml -l swift3 -o swaggeroutput/
The text was updated successfully, but these errors were encountered: