Skip to content

[CPPREST][CPP] Several Compilation Errors, setTags method missing #5862

@solvingj

Description

@solvingj
Description

There are several methods which are causing compilation errors.
fromJson
fromMultipart
setTags

While I am able to find fromJson and fromMultipart, I cannot find the method setTags method anywhere. Interestingly, I generated Petstore and Petstore on Heroku samples and this method was not referenced anywhere in that code. Perhaps those specs don't have custom tags and my spec does.

Swagger-codegen version

http://editor.swagger.io
http://editor2.swagger.io

Swagger declaration file content or url

Here is the JSON Swagger spec:
https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-iothub/2017-01-19/swagger/iothub.json

Command line used for generation

http://editor.swagger.io
http://editor2.swagger.io

Both produce this method setTags()

Steps to reproduce
  1. Generate the code from the provided swagger spec using the web editor.
  2. Open file model\Resource.cpp
  3. Navigate to line 166 and find :

setTags( newItem );

This method does not exist anywhere in any version of the the Microsoft CPPREST library:
https://github.com/Microsoft/cpprestsdk
Nor does it exist in the generated sources.

Related issues

I could find no previous github issue referencing the setTags method.

Suggest a Fix

I noticed that the QT5 sample for petstore also references the setTags method. In researching, I saw that the CPPREST generator was probably based off the QT5 generator to some extent. It seems possible that the generation of setTags() was copied from the QT5 generator but without the code that generates an implementation of the method. Meanwhile, perhaps none of the sample specs used for testing happen to feature custom tags, so it never got generated during testing and never discovered. All very speculative, I'm really not sure.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions