Skip to content

Commit e5a5419

Browse files
authored
Merge branch 'OpenAPITools:master' into patch-1
2 parents 10b0106 + 387fd99 commit e5a5419

File tree

168 files changed

+6260
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+6260
-711
lines changed

bin/configs/elixir.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: elixir
22
outputDir: samples/client/petstore/elixir
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/elixir/petstore-with-fake-endpoints-models-for-testing.yaml
44
templateDir: modules/openapi-generator/src/main/resources/elixir
55
additionalProperties:
66
invokerPackage: OpenapiPetstore
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
generatorName: typescript-angular
2+
outputDir: samples/client/petstore/typescript-angular-v19-with-angular-dependency-params/builds/default
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
5+
additionalProperties:
6+
ngVersion: 19.0.1
7+
npmName: sample-angular-19-0-0-with-angular-dependency-params
8+
supportsES6: true
9+
tsVersion: 5.6.3
10+
zonejsVersion: 0.15.0
11+
ngPackagrVersion: 19.0.1
12+
rxjsVersion: 6.5.3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
generatorName: typescript-angular
2-
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
2+
outputDir: samples/client/petstore/typescript-angular-v19/builds/default
33
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
44
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
55
additionalProperties:
66
ngVersion: 19.0.0
7+
npmName: sample-angular-19-0-0
78
supportsES6: true

docs/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "FAQ: General"
55

66
## Do you have a chat room?
77

8-
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g)
8+
[![Join the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/zt-2uoef5v0g-XGwo8~2oJ3EoziDSO1CmdQ)
99

1010
## What is the governance structure of the OpenAPI Generator project?
1111

docs/generators/typescript-angular.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5656
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
5757
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
5858
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
59-
|zoneJsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null|
59+
|zonejsVersion|The version of zone.js compatible with Angular (see ngVersion option).| |null|
6060

6161
## IMPORT MAPPING
6262

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,7 @@ private void processOperation(String resourcePath, String httpMethod, Operation
16191619
}
16201620

16211621
private static String generateParameterId(Parameter parameter) {
1622-
return parameter.getName() + ":" + parameter.getIn();
1622+
return null == parameter.get$ref() ? parameter.getName() + ":" + parameter.getIn() : parameter.get$ref() ;
16231623
}
16241624

16251625
private OperationsMap processOperations(CodegenConfig config, String tag, List<CodegenOperation> ops, List<ModelMap> allModels) {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,9 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<Mo
962962
).trim();
963963
return "multipart/form-data".equals(mediaType)
964964
|| "application/x-www-form-urlencoded".equals(mediaType)
965-
|| (mediaType.startsWith("application/") && (mediaType.endsWith("json") || mediaType.endsWith("octet-stream")));
965+
|| (mediaType.startsWith("application/") && mediaType.endsWith("json"))
966+
|| "application/octet-stream".equals(mediaType)
967+
|| "text/plain".equals(mediaType);
966968
};
967969
operation.consumes = operation.consumes == null ? null : operation.consumes.stream()
968970
.filter(isSerializable)

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static enum PROVIDED_IN_LEVEL {none, root, any, platform}
8181
public static final String TS_VERSION = "tsVersion";
8282
public static final String RXJS_VERSION = "rxjsVersion";
8383
public static final String NGPACKAGR_VERSION = "ngPackagrVersion";
84-
public static final String ZONEJS_VERSION = "zoneJsVersion";
84+
public static final String ZONEJS_VERSION = "zonejsVersion";
8585

8686
protected String ngVersion = "19.0.0";
8787
@Getter @Setter
@@ -321,21 +321,21 @@ private void addNpmPackageGeneration(SemVer ngVersion) {
321321
.map(Map.Entry::getValue)
322322
.orElseThrow(() -> new IllegalArgumentException("Invalid ngVersion. Only Angular v9+ is supported."));
323323

324-
additionalProperties.put(TS_VERSION, additionalProperties.containsKey(TS_VERSION)
325-
? additionalProperties.containsKey(TS_VERSION)
326-
: angularDependencies.getTsVersion());
324+
if (!additionalProperties.containsKey(TS_VERSION)) {
325+
additionalProperties.put(TS_VERSION, angularDependencies.getTsVersion());
326+
}
327327

328-
additionalProperties.put(RXJS_VERSION, additionalProperties.containsKey(RXJS_VERSION)
329-
? additionalProperties.containsKey(RXJS_VERSION)
330-
: angularDependencies.getRxjsVersion());
328+
if (!additionalProperties.containsKey(RXJS_VERSION)) {
329+
additionalProperties.put(RXJS_VERSION, angularDependencies.getRxjsVersion());
330+
}
331331

332-
additionalProperties.put(NGPACKAGR_VERSION, additionalProperties.containsKey(NGPACKAGR_VERSION)
333-
? additionalProperties.containsKey(NGPACKAGR_VERSION)
334-
: angularDependencies.getNgPackagrVersion());
332+
if (!additionalProperties.containsKey(NGPACKAGR_VERSION)) {
333+
additionalProperties.put(NGPACKAGR_VERSION, angularDependencies.getNgPackagrVersion());
334+
}
335335

336-
additionalProperties.put("zonejsVersion", additionalProperties.containsKey(ZONEJS_VERSION)
337-
? additionalProperties.containsKey(ZONEJS_VERSION)
338-
: angularDependencies.getZonejsVersion());
336+
if (!additionalProperties.containsKey(ZONEJS_VERSION)) {
337+
additionalProperties.put(ZONEJS_VERSION, angularDependencies.getZonejsVersion());
338+
}
339339

340340
if (angularDependencies.getTsickleVersion() != null) {
341341
additionalProperties.put("tsickleVersion", angularDependencies.getTsickleVersion());

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

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#ifndef {{modelHeaderGuardPrefix}}_{{classname}}_H_
99
#define {{modelHeaderGuardPrefix}}_{{classname}}_H_
1010

11+
{{#hasEnums}}
12+
#include <stdexcept>
13+
{{/hasEnums}}
1114
{{#oneOf}}
1215
{{#-first}}
1316
#include <variant>
@@ -125,9 +128,11 @@ public:
125128
{{/isEnum}}
126129
{{^isEnum}}
127130

131+
{{#description}}
128132
/// <summary>
129133
/// {{description}}
130134
/// </summary>
135+
{{/description}}
131136
class {{declspec}} {{classname}}
132137
: public {{{parent}}}{{^parent}}ModelBase{{/parent}}
133138
{
@@ -146,35 +151,101 @@ public:
146151
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
147152
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
148153

154+
149155
/////////////////////////////////////////////
150156
/// {{classname}} members
151157

158+
{{! ENUM DEFINITIONS }}
152159
{{#vars}}
153160
{{^isInherited}}
161+
{{#isEnum}}
162+
enum class {{#isContainer}}{{{enumName}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}{{/isContainer}}
163+
{
164+
{{#allowableValues}}{{#enumVars}}{{value}},
165+
{{/enumVars}}{{/allowableValues}}
166+
};
167+
{{#description}}
154168
/// <summary>
155169
/// {{description}}
156170
/// </summary>
157-
{{#isContainer}}{{{dataType}}}& {{getter}}();
158-
{{/isContainer}}{{^isContainer}}{{{dataType}}} {{getter}}() const;
159-
{{/isContainer}}bool {{nameInCamelCase}}IsSet() const;
160-
void unset{{name}}();
171+
{{/description}}
172+
{{/isEnum}}
173+
{{/isInherited}}
174+
{{/vars}}
175+
{{#vars}}
176+
{{^isInherited}}
177+
{{#isEnum}}
178+
{{#isContainer}}
179+
{{! ENUM CONVERSIONS }}
180+
{{{enumName}}} to{{{enumName}}}(const utility::string_t& value) const;
181+
const utility::string_t from{{{enumName}}}(const {{{enumName}}} value) const;
182+
{{#isArray}}
183+
{{{datatypeWithEnum}}} to{{{enumName}}}(const {{{dataType}}}& value) const;
184+
{{{dataType}}} from{{{enumName}}}(const {{{datatypeWithEnum}}}& value) const;
185+
{{/isArray}}{{/isContainer}}{{^isContainer}}
186+
{{{datatypeWithEnum}}} to{{{datatypeWithEnum}}}(const utility::string_t& value) const;
187+
const utility::string_t from{{{datatypeWithEnum}}}(const {{{datatypeWithEnum}}} value) const;
188+
{{/isContainer}}
189+
190+
{{/isEnum}}
191+
{{/isInherited}}
192+
{{/vars}}
161193

194+
{{! SETTER AND GETTERS }}
195+
{{#vars}}
196+
{{^isInherited}}
197+
{{#description}}
198+
/// <summary>
199+
/// {{description}}
200+
/// </summary>
201+
{{/description}}
202+
{{#isContainer}}
203+
{{^isEnum}}
204+
{{{dataType}}} {{getter}}() const;
205+
{{/isEnum}}
206+
{{/isContainer}}
207+
{{^isContainer}}
208+
{{^isEnum}}
209+
{{{dataType}}} {{getter}}() const;
210+
{{/isEnum}}
211+
{{/isContainer}}
212+
{{#isEnum}}
213+
{{^isMap}}
214+
{{{datatypeWithEnum}}} {{getter}}() const;
215+
{{/isMap}}
216+
{{#isMap}}
217+
{{{dataType}}} {{getter}}() const;
218+
{{/isMap}}
219+
{{/isEnum}}
220+
bool {{nameInCamelCase}}IsSet() const;
221+
void unset{{name}}();
162222
{{#isPrimitiveType}}
163223
void {{setter}}({{{dataType}}} value);
164224
{{/isPrimitiveType}}
165225
{{^isPrimitiveType}}
226+
{{^isEnum}}
166227
void {{setter}}(const {{{dataType}}}& value);
228+
{{/isEnum}}
167229
{{/isPrimitiveType}}
168-
230+
{{#isEnum}}
231+
void {{setter}}(const {{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} value);
232+
{{/isEnum}}
169233
{{/isInherited}}
234+
170235
{{/vars}}
171236

172237
protected:
173238
{{#vars}}
174239
{{^isInherited}}
240+
{{^isEnum}}
175241
{{{dataType}}} m_{{name}};
242+
{{/isEnum}}
243+
{{#isEnum}}
244+
{{^isMap}}{{{datatypeWithEnum}}}{{/isMap}}{{#isMap}}{{{dataType}}}{{/isMap}} m_{{name}};
245+
{{/isEnum}}
176246
bool m_{{name}}IsSet;
177247
{{/isInherited}}
248+
178249
{{/vars}}
179250
};
180251

0 commit comments

Comments
 (0)