Skip to content

cpprest runtime bug with form parameters #6522

@WendellDuncan

Description

@WendellDuncan
Description

After using the cpprest c++ language target, I was having runtime crashes.
I tracked it down to the ApiClient.cpp code. If there were no form parameters, it was setting the
html body to a badly initialized state.

I am a C++ programmer and am not well versed in html, but a check for the existence of
any form parameters and not setting the body if there are none did fix my crash.
Perhaps an alternate implementation
of a good default would also be a solution.

Swagger-codegen version

This is running against the head of the 3.0 branch

Swagger declaration file content or url

The moustache produces the same code for any json swagger input.
The generated file is ApiClient.cpp. Usually around line 139 -- can vary by one or
two lines if different namespaces from the default are used.

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i ~/hoops/Hoops/VisualizePmi/Modules/cpprest-cad-api/cruiser-dev-cad-api.json -o /tmp/cad -l cpprest -c ~/hoops/Hoops/VisualizePmi/Modules/cpprest-cad-api/swagger-config.json

Steps to reproduce

Generate a cpprest target. The ApiClient.cpp will have the code in it.

Related issues/PRs
Suggest a fix/enhancement

I will open a pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions