swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[cpprest] Bug: using multipart/form-data without files leads application/x-www-form-urlencoded falsely being used

Open cipold opened this issue 7 years ago • 0 comments

Description

When using multipart/form-data as content type without files the generated code instead uses content type application/x-www-form-urlencoded: https://github.com/cipold/swagger-codegen/blob/master/samples/client/petstore/cpprest/ApiClient.cpp#L108

Swagger-codegen version

master / 2.4.11-SNAPSHOT

Swagger declaration file content or url

modules/swagger-codegen/src/test/resources/2_0/petstore.yaml

Command line used for generation

./run-in-docker.sh generate -t modules/swagger-codegen/src/main/resources/cpprest -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l cpprest -o samples/client/petstore/cpprest

Steps to reproduce
  • Run the command line
  • See defective generated example file
Suggest a fix/enhancement

I will submit a PR fixing the issue

cipold avatar Dec 02 '19 12:12 cipold