Skip to content

[CPPREST] Arbitrary object type results in a compilation error (missing Object.h) #6512

@frol

Description

@frol
Description

Using Codegen on the swagger specification file containing properties of the arbitrary object type results in the following compilation error:

.../model/Inline_response_200.h:25:10: fatal error: Object.h: No such file or directory
 #include "Object.h"
          ^~~~~~~~~~
Swagger-codegen version

I am using the master branch, but I believe that the issue is there from the initial introduction of CPPREST generator.

Swagger declaration file content or url
swagger: "2.0"
info:
  title: "title"
  version: "1.0.0"
paths:
  /pets/:
    get:
      parameters:
      - name: "offset"
        in: "query"
        required: false
        type: "integer"
      responses:
        200:
          description: "successful operation"
          schema:
            type: "object"
            properties:
              extra_info:
                type: "object"
Steps to reproduce

Just run the generator and try building the module:

$ mkdir build
$ cd build
$ cmake -D CPPREST_ROOT=/usr ../
$ make -j 8
Suggest a fix/enhancement

It seems that there should be Object.h implementation (it seems that the standard hash map can be used here).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions