Skip to content

Commit 4be24f3

Browse files
committed
Merge branch 'master' into fix-cpp-qt-enum-asjsonobject
2 parents f2d0cf9 + f281371 commit 4be24f3

File tree

474 files changed

+6771
-2205
lines changed

Some content is hidden

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

474 files changed

+6771
-2205
lines changed

.devcontainer/devcontainer.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
},
1212
"ghcr.io/devcontainers/features/rust:1": {},
1313
"ghcr.io/snebjorn/devcontainer-feature/chromium:latest": {},
14-
"docker-in-docker": {
14+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
1515
"version": "latest",
16-
"moby": true,
17-
"dockerDashComposeVersion": "v1"
16+
"moby": true
1817
}
1918
},
2019
// Configure tool-specific properties.

.github/CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @martindelille
2828
samples/client/petstore/cpp-qt/**/* @martindelille
2929
modules/openapi-generator/src/main/resources/cpp-qt-client/**/* @muttleyxd
3030
samples/client/petstore/cpp-qt/**/* @muttleyxd
31+
32+
# cpp-rest-client technical committee
33+
modules/openapi-generator/src/main/resources/cpp-rest-client/**/* @aminya
34+
samples/client/petstore/cpp-restsdk/**/* @aminya

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010
#### Bug Report Checklist
1111

1212
- [ ] Have you provided a full/minimal spec to reproduce the issue?
13-
- [ ] Have you validated the input using an OpenAPI validator ([example](https://apitools.dev/swagger-parser/online/))?
13+
- [ ] Have you validated the input using an OpenAPI validator?
1414
- [ ] Have you [tested with the latest master](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) to confirm the issue still exists?
1515
- [ ] Have you searched for related issues/PRs?
1616
- [ ] What's the actual output vs expected output?

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
./bin/generate-samples.sh ./bin/configs/*.yaml || exit
1212
./bin/utils/export_docs_generators.sh || exit
1313
```
14-
(For Windows users, please run the script in [Git BASH](https://gitforwindows.org/))
14+
(For Windows users, please run the script in [WSL](https://learn.microsoft.com/en-us/windows/wsl/install))
1515
Commit all changed files.
1616
This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
1717
These must match the expectations made by your contribution.

.github/workflows/openapi-generator.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
run: |
145145
rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld
146146
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
147+
rm -rf samples/client/petstore/csharp/generichost/latest/OneOfList
147148
148149
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
149150
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf

.github/workflows/samples-dotnet9.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
sample:
2626
- samples/client/petstore/csharp/generichost/latest/Tags
2727
- samples/client/petstore/csharp/generichost/latest/HelloWorld
28+
- samples/client/petstore/csharp/generichost/latest/OneOfList
2829
- samples/client/petstore/csharp/generichost/net9/AllOf
2930
- samples/client/petstore/csharp/generichost/net9/AnyOf
3031
- samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare

.github/workflows/samples-elixir.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Samples Elixir
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/petstore/elixir/**
7+
pull_request:
8+
paths:
9+
- samples/client/petstore/elixir/**
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
14+
strategy:
15+
matrix:
16+
otp: ['25.3.2', '26.2.5', '27.3.3']
17+
elixir: ['1.18.3']
18+
sample:
19+
- samples/client/petstore/elixir/
20+
services:
21+
petstore-api:
22+
image: swaggerapi/petstore
23+
ports:
24+
- 80:8080
25+
env:
26+
SWAGGER_HOST: http://petstore.swagger.io
27+
SWAGGER_BASE_PATH: /v2
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: erlef/setup-beam@v1
31+
with:
32+
otp-version: ${{matrix.otp}}
33+
elixir-version: ${{matrix.elixir}}
34+
- name: mix deps.get
35+
run: mix deps.get
36+
working-directory: ${{ matrix.sample }}
37+
- name: mix test
38+
run: mix test
39+
working-directory: ${{ matrix.sample }}

README.md

+43-27
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,48 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
9797

9898
## Table of contents
9999

100-
- [OpenAPI Generator](#openapi-generator)
101-
- [Overview](#overview)
102-
- [Table of Contents](#table-of-contents)
103-
- [1 - Installation](#1---installation)
104-
- [1.1 - Compatibility](#11---compatibility)
105-
- [1.2 - Artifacts on Maven Central](#12---artifacts-on-maven-central)
106-
- [1.3 - Download JAR](#13---download-jar)
107-
- [1.4 - Build Projects](#14---build-projects)
108-
- [1.5 - Homebrew](#15---homebrew)
109-
- [1.6 - Docker](#16---docker)
110-
- [1.7 - NPM](#17---npm)
111-
- [1.8 - pip](#18---pip)
112-
- [2 - Getting Started](#2---getting-started)
113-
- [3 - Usage](#3---usage)
114-
- [3.1 - Customization](#31---customization)
115-
- [3.2 - Workflow Integration](#32---workflow-integration-maven-gradle-github-cicd)
116-
- [3.3 - Online Generators](#33---online-openapi-generator)
117-
- [3.4 - License Information on Generated Code](#34---license-information-on-generated-code)
118-
- [3.5 - IDE Integration](#35---ide-integration)
119-
- [4 - Companies/Projects using OpenAPI Generator](#4---companiesprojects-using-openapi-generator)
120-
- [5 - Presentations/Videos/Tutorials/Books](#5---presentationsvideostutorialsbooks)
121-
- [6 - About Us](#6---about-us)
122-
- [6.1 - OpenAPI Generator Core Team](#61---openapi-generator-core-team)
123-
- [6.2 - OpenAPI Generator Technical Committee](#62---openapi-generator-technical-committee)
124-
- [6.3 - History of OpenAPI Generator](#63---history-of-openapi-generator)
125-
- [7 - License](#7---license)
100+
- [Sponsors](#sponsors)
101+
- [Thank you to our bronze sponsors!](#thank-you-to-our-bronze-sponsors)
102+
- [Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS, Checkly for sponsoring the API monitoring and Gradle for sponsoring Develocity](#thank-you-godaddy-for-sponsoring-the-domain-names-linode-for-sponsoring-the-vps-checkly-for-sponsoring-the-api-monitoring-and-gradle-for-sponsoring-develocity)
103+
- [Overview](#overview)
104+
- [Table of contents](#table-of-contents)
105+
- [1 - Installation](#1---installation)
106+
- [1.1 - Compatibility](#11---compatibility)
107+
- [1.2 - Artifacts on Maven Central](#12---artifacts-on-maven-central)
108+
- [1.3 - Download JAR](#13---download-jar)
109+
- [Launcher Script](#launcher-script)
110+
- [1.4 - Build Projects](#14---build-projects)
111+
- [Nix users](#nix-users)
112+
- [1.5 - Homebrew](#15---homebrew)
113+
- [1.6 - Docker](#16---docker)
114+
- [Public Pre-built Docker images](#public-pre-built-docker-images)
115+
- [OpenAPI Generator CLI Docker Image](#openapi-generator-cli-docker-image)
116+
- [OpenAPI Generator Online Docker Image](#openapi-generator-online-docker-image)
117+
- [Development in docker](#development-in-docker)
118+
- [Troubleshooting](#troubleshooting)
119+
- [Run Docker in Vagrant](#run-docker-in-vagrant)
120+
- [1.7 - NPM](#17---npm)
121+
- [1.8 - pip](#18---pip)
122+
- [2 - Getting Started](#2---getting-started)
123+
- [3 - Usage](#3---usage)
124+
- [To generate a sample client library](#to-generate-a-sample-client-library)
125+
- [3.1 - Customization](#31---customization)
126+
- [3.2 - Workflow Integration (Maven, Gradle, Github, CI/CD)](#32---workflow-integration-maven-gradle-github-cicd)
127+
- [3.3 - Online OpenAPI generator](#33---online-openapi-generator)
128+
- [3.4 - License information on Generated Code](#34---license-information-on-generated-code)
129+
- [3.5 - IDE Integration](#35---ide-integration)
130+
- [4 - Companies/Projects using OpenAPI Generator](#4---companiesprojects-using-openapi-generator)
131+
- [5 - Presentations/Videos/Tutorials/Books](#5---presentationsvideostutorialsbooks)
132+
- [6 - About Us](#6---about-us)
133+
- [6.1 - OpenAPI Generator Core Team](#61---openapi-generator-core-team)
134+
- [Core Team Members](#core-team-members)
135+
- [Template Creator](#template-creator)
136+
- [How to join the core team](#how-to-join-the-core-team)
137+
- [6.2 - OpenAPI Generator Technical Committee](#62---openapi-generator-technical-committee)
138+
- [Members of Technical Committee](#members-of-technical-committee)
139+
- [6.3 - History of OpenAPI Generator](#63---history-of-openapi-generator)
140+
- [Founding Members (alphabetical order):](#founding-members-alphabetical-order)
141+
- [7 - License](#7---license)
126142

127143
## [1 - Installation](#table-of-contents)
128144

@@ -1219,7 +1235,7 @@ If you want to join the committee, please kindly apply by sending an email to te
12191235
| Apex | |
12201236
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
12211237
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) @eafer (2024/12) |
1222-
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
1238+
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) @aminya (2025/05) |
12231239
| C# | @mandrean (2017/08) @shibayan (2020/02) @Blackclaws (2021/03) @lucamazzanti (2021/05) @iBicha (2023/07) |
12241240
| Clojure | |
12251241
| Crystal | @cyangle (2021/01) |

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ build_script:
4545
test_script:
4646
- dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4747
- dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
48+
- dotnet test samples\client\petstore\csharp\generichost\latest\OneOfList\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
4849

4950
- dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
5051
- dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
generatorName: csharp
2+
outputDir: samples/client/petstore/csharp/generichost/latest/OneOfList
3+
inputSpec: modules/openapi-generator/src/test/resources/bugs/issue_20739.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/csharp
5+
additionalProperties:
6+
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
7+
modelPropertySorting: alphabetical
8+
operationParameterSorting: alphabetical

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

+34-32
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424

2525
public class CodegenOperation {
2626
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
27-
public boolean hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams, hasRequiredParams,
27+
public boolean hasAuthMethods, hasConsumes, hasProduces, hasOptionalParams,
2828
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
2929
isArray, isMultipart, isVoid = false,
3030
hasVersionHeaders = false, hasVersionQueryParams = false,
3131
isResponseBinary = false, isResponseFile = false, isResponseOptional = false, hasReference = false, defaultReturnType = false,
32-
isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
33-
isRestful, isDeprecated, isCallbackRequest, uniqueItems, hasDefaultResponse = false, hasOnlyDefaultResponse = false, hasConstantParams = false,
34-
hasErrorResponseObject, // if 4xx, 5xx responses have at least one error object defined
35-
hasSingleParam = false; // if the operation has only one parameter;
32+
isDeprecated, isCallbackRequest, uniqueItems,
33+
hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined
3634
public CodegenProperty returnProperty;
3735
public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType,
3836
returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse;
@@ -81,6 +79,33 @@ private static boolean nonEmpty(Map<?, ?> params) {
8179
return params != null && !params.isEmpty();
8280
}
8381

82+
/**
83+
* Check if there's at least one parameter
84+
*
85+
* @return true if parameter exists, false otherwise
86+
*/
87+
public boolean getHasParams() {
88+
return nonEmpty(allParams);
89+
}
90+
91+
/**
92+
* Check if there's at least one required parameter
93+
*
94+
* @return true if required parameter exists, false otherwise
95+
*/
96+
public boolean getHasRequiredParam() {
97+
return nonEmpty(requiredParams);
98+
}
99+
100+
/**
101+
* Check if there's exactly one parameter
102+
*
103+
* @return true if exactly one parameter exists, false otherwise
104+
*/
105+
public boolean getHasSingleParam() {
106+
return allParams.size() == 1;
107+
}
108+
84109
/**
85110
* Check if there's at least one body parameter
86111
*
@@ -362,9 +387,7 @@ public String toString() {
362387
sb.append(", hasAuthMethods=").append(hasAuthMethods);
363388
sb.append(", hasConsumes=").append(hasConsumes);
364389
sb.append(", hasProduces=").append(hasProduces);
365-
sb.append(", hasParams=").append(hasParams);
366390
sb.append(", hasOptionalParams=").append(hasOptionalParams);
367-
sb.append(", hasRequiredParams=").append(hasRequiredParams);
368391
sb.append(", returnTypeIsPrimitive=").append(returnTypeIsPrimitive);
369392
sb.append(", returnSimpleType=").append(returnSimpleType);
370393
sb.append(", subresourceOperation=").append(subresourceOperation);
@@ -377,16 +400,7 @@ public String toString() {
377400
sb.append(", isResponseFile=").append(isResponseFile);
378401
sb.append(", isResponseOptional=").append(isResponseOptional);
379402
sb.append(", hasReference=").append(hasReference);
380-
sb.append(", hasDefaultResponse=").append(hasDefaultResponse);
381-
sb.append(", hasOnlyDefaultResponse=").append(hasOnlyDefaultResponse);
382403
sb.append(", hasErrorResponseObject=").append(hasErrorResponseObject);
383-
sb.append(", hasSingleParam=").append(hasSingleParam);
384-
sb.append(", isRestfulIndex=").append(isRestfulIndex);
385-
sb.append(", isRestfulShow=").append(isRestfulShow);
386-
sb.append(", isRestfulCreate=").append(isRestfulCreate);
387-
sb.append(", isRestfulUpdate=").append(isRestfulUpdate);
388-
sb.append(", isRestfulDestroy=").append(isRestfulDestroy);
389-
sb.append(", isRestful=").append(isRestful);
390404
sb.append(", isDeprecated=").append(isDeprecated);
391405
sb.append(", isCallbackRequest=").append(isCallbackRequest);
392406
sb.append(", uniqueItems='").append(uniqueItems);
@@ -445,9 +459,7 @@ public boolean equals(Object o) {
445459
return hasAuthMethods == that.hasAuthMethods &&
446460
hasConsumes == that.hasConsumes &&
447461
hasProduces == that.hasProduces &&
448-
hasParams == that.hasParams &&
449462
hasOptionalParams == that.hasOptionalParams &&
450-
hasRequiredParams == that.hasRequiredParams &&
451463
returnTypeIsPrimitive == that.returnTypeIsPrimitive &&
452464
returnSimpleType == that.returnSimpleType &&
453465
subresourceOperation == that.subresourceOperation &&
@@ -459,16 +471,7 @@ public boolean equals(Object o) {
459471
isResponseFile == that.isResponseFile &&
460472
isResponseOptional == that.isResponseOptional &&
461473
hasReference == that.hasReference &&
462-
hasDefaultResponse == that.hasDefaultResponse &&
463-
hasOnlyDefaultResponse == that.hasOnlyDefaultResponse &&
464474
hasErrorResponseObject == that.hasErrorResponseObject &&
465-
hasSingleParam == that.hasSingleParam &&
466-
isRestfulIndex == that.isRestfulIndex &&
467-
isRestfulShow == that.isRestfulShow &&
468-
isRestfulCreate == that.isRestfulCreate &&
469-
isRestfulUpdate == that.isRestfulUpdate &&
470-
isRestfulDestroy == that.isRestfulDestroy &&
471-
isRestful == that.isRestful &&
472475
isDeprecated == that.isDeprecated &&
473476
isCallbackRequest == that.isCallbackRequest &&
474477
uniqueItems == that.uniqueItems &&
@@ -522,16 +525,15 @@ public boolean equals(Object o) {
522525
@Override
523526
public int hashCode() {
524527

525-
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasParams, hasOptionalParams,
526-
hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
528+
return Objects.hash(responseHeaders, hasAuthMethods, hasConsumes, hasProduces, hasOptionalParams,
529+
returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap,
527530
isArray, isMultipart, isVoid, isResponseBinary, isResponseFile, isResponseOptional, hasReference,
528-
hasDefaultResponse, hasOnlyDefaultResponse, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy,
529-
isRestful, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,
531+
isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod,
530532
returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse,
531533
discriminator, consumes, produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams,
532534
pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, returnProperty, optionalParams,
533535
authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs,
534536
vendorExtensions, nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase,
535-
operationIdSnakeCase, hasErrorResponseObject, hasSingleParam, requiredAndNotNullableParams, notNullableParams, constantParams);
537+
operationIdSnakeCase, hasErrorResponseObject, requiredAndNotNullableParams, notNullableParams, constantParams);
536538
}
537539
}

0 commit comments

Comments
 (0)