Skip to content

Commit 0ebc714

Browse files
dan-drletherealjoy
authored andcommitted
[C++][RESTSDK] models header fix (#2750)
* Fix issue including header, the filename not the class name should be used to import a header file. * Include header file name, not class name. Header file name and class name differ. * Update petstore samples
1 parent 567eb6c commit 0ebc714

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public String toModelImport(String name) {
208208
if (importMapping.containsKey(name)) {
209209
return importMapping.get(name);
210210
} else {
211-
return "#include \"" + sanitizeName(name) + ".h\"";
211+
return "#include \"" + toModelFilename(name) + ".h\"";
212212
}
213213
}
214214

modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{>licenseInfo}}
22
{{#models}}{{#model}}
33

4-
#include "{{classname}}.h"
4+
#include "{{classFilename}}.h"
55

66
{{#modelNamespaceDeclarations}}
77
namespace {{this}} {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.4
1+
4.0.0-SNAPSHOT

0 commit comments

Comments
 (0)