-
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
[Elixir] Bug in 2.3.1. Generating multi-part body instead of direct JSON content #8138
Comments
I just debugged myself to the same thing, so i agree on the :body, :body part :) |
chgeuer
added a commit
to chgeuer/swagger-api--swagger-codegen
that referenced
this issue
Jul 3, 2018
When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body.
wing328
pushed a commit
to OpenAPITools/openapi-generator
that referenced
this issue
Nov 20, 2018
…en#8138 When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body.
wing328
added a commit
to OpenAPITools/openapi-generator
that referenced
this issue
Nov 28, 2018
* Fix swagger-api/swagger-codegen/issues/8138 swagger-api/swagger-codegen#8138 When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body. * update elixir samples * update elixir client samples * remove double quote
A-Joshi
pushed a commit
to ihsmarkitoss/openapi-generator
that referenced
this issue
Feb 27, 2019
* Fix swagger-api/swagger-codegen/issues/8138 swagger-api/swagger-codegen#8138 When JSON payload needs to be in the body (`"in": "body"`), it must not generate a multi-part body, but embed directly in HTTP body. * update elixir samples * update elixir client samples * remove double quote
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The generated
Elixir
code from a Swagger definition seems to be wrong, but I'm not sure.I try to generate an Elixir SDK for the Azure Resource Management API. I wrote a generator app, which uses uses
swagger-codegen-cli-2.3.1.jar
to generate Elixir code.The swagger spec document says
"in": "body"
, and the API expects JSON structure directly in the body, but the Elixir code generates a multi-part body.The Elixir swagger generator creates this code
The parameter JSON is added as
|> add_param(:body, :"parameters", parameters)
, which results ininstead of
Shouldn't the generated SDK code be
add_param(:body, :body, parameters)
instead ofadd_param(:body, :"parameters", parameters)
?When I check the Swagger 2 Spec, it says that
in: body
means that the payload is directly in the body, not in a Multi-part message.Swagger-codegen version
I am using version
2.3.1
Swagger declaration file content or url
The Swagger definition is https://github.com/Azure/azure-rest-api-specs/blob/master/specification/resources/resource-manager/Microsoft.Resources/stable/2018-02-01/resources.json#L155-L162
Command line used for generation
Consumer-side fix
When I replace all occurrences of
add_param(:body, :"whatever-here", parameters)
in the.ex
-files, my SDK works./cc @niku
The text was updated successfully, but these errors were encountered: