Skip to content

Adding datetime query parameter support to CPPREST #4549

@genechang

Description

@genechang
Description

The generated code for CPPREST doesn't have support for a datetime query parameter. In ApiClient there isn't a parameterToString to handle datetime.

Swagger-codegen version

Found in tip of master.

Swagger declaration file content or url
<script src="https://gist.github.com/genechang/425e0d5ab16fd2a4f11160317df1f8da.js"></script>
Command line used for generation

java -jar swagger-codegen\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate --lang cpprest --input-spec webapp-swagger\src\main\resources\swagger.json --api-package=com.anyconnect.client.api --model-package=com.anyconnect.client.model

Steps to reproduce

Generate code and inspect code. ApiClient doesn't have an overload for parameterToString(utility::datetime)

Related issues

I couldn't find one.

Suggest a Fix

In the mustache file for ApiClient, add an overload for parameterToString to handle datetime. In the datetime.to_string() use ISO_8601 date formatting standard. I forked the repo and can have a pull request with my fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions