Skip to content

[C++][pistache-server] include not existing file "Object.h" #9400

@haibinzero

Description

@haibinzero
Description

In the generated file "DefaultApi.h" which includes "Object.h" but the "Object.h" not exist under the root output directory. Here already found the same issue reported in [cpprest] but I really can't find why this file was generated since the spec file is valid. #6512 #6905

Swagger-codegen version

2.4.5

Swagger declaration file content or url

spec

Command line used for generation
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \
-i swagger.yaml \
-l pistache-server \
-o /auto_code/cpp
Steps to reproduce

The auto generated files:

[root@kongfu cpp]# tree
.
├── api
│   ├── DefaultApi.cpp
│   └── DefaultApi.h
├── CMakeLists.txt
├── DefaultApiMainServer.cpp
├── impl
│   ├── DefaultApiImpl.cpp
│   └── DefaultApiImpl.h
├── model
│   ├── Interface.cpp
│   ├── Interface.h
│   ├── Link.cpp
│   ├── Link.h
│   ├── ModelBase.cpp
│   └── ModelBase.h
└── README.md

The DefaultApiImpl.h which includes "Object.h"

/*
 * DefaultApi.h
 *
 *
 */

#ifndef DefaultApi_H_
#define DefaultApi_H_


#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>

#include "Interface.h"
#include "Object.h"
#include <string>

namespace io {
namespace swagger {
namespace server {
namespace api {

using namespace io::swagger::server::model;

class  DefaultApi {

Related issues/PRs

#6512
#6905

Suggest a fix/enhancement

The Object.h should not be generated here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions