Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6540
Closed
Open
Issue created Jun 04, 2020 by Administrator@rootContributor2 of 6 checklist items completed2/6 checklist items

[BUG][CPPRestSDK] Generated CPPRestSDK client does not compile in Visual Studio 2017

Created by: JordiGR-TheBreachStudios

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)? N/A
  • What's the version of OpenAPI Generator used? N/A
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The generated CPPRestSDK client for the sample Pet Store does not compile in Visual Studio 2017 (CMake generated Visual Studio solution), with the following error:

2>...\samples\client\petstore\cpp-restsdk\client\ModelBase.cpp(239): error C2664: 'void org::openapitools::client::model::HttpContent::setData(std::shared_ptrstd::istream)': cannot convert argument 1 from 'std::shared_ptr < utility::stringstream_t >' to 'std::shared_ptr < std::istream >' 2>...\samples\client\petstore\cpp-restsdk\client\ModelBase.cpp(239): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

When using the CPPRestSDK library for Windows, in its basic_types.h the type utility::stringstream_t is always defined as an alias for std::wstringstream. However, the generated HttpContent::setData method always takes a std::shared_ptr < std::istream > as parameter, not a std::shared_ptr < std::wistream >

I need help with this. It's a blocker for any CPPRestSDK generated API client for Windows.

openapi-generator version

The client API is already generated in the openapi-generator repository.

OpenAPI declaration file content or url

The client API is already generated in the openapi-generator repository.

Command line used for generation

N/A

Steps to reproduce

Install CPPRestSDK with vcpck, as described in CPPRestSDK Modify the local CMakeLists.txt file for compilation with vcpkg, as described in the file contents. Generate the Visual Studio solution with 'cmake -G "Visual Studio 15 2017" < path of the CMakeLists.txt file > ' or 'cmake -G "Visual Studio 15 2017 Win64" < path of the CMakeLists.txt file > ' Open the generated solution and compile

Related issues/PRs

None

Suggest a fix

See the description above.

Assignee
Assign to
Time tracking