Skip to content

Commit

Permalink
Merge branch 'master' into java-anyof-oneof
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-mfg committed Oct 9, 2024
2 parents e7dbea1 + 627c0f4 commit cbc0774
Show file tree
Hide file tree
Showing 6,850 changed files with 8,455 additions and 8,576 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.14.0
uses: s4u/setup-maven-action@v1.15.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Maven
uses: s4u/setup-maven-action@v1.14.0
uses: s4u/setup-maven-action@v1.15.0
with:
java-version: 11
maven-version: 3.8.8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Setup Maven
uses: s4u/setup-maven-action@v1.14.0
uses: s4u/setup-maven-action@v1.15.0
with:
java-version: ${{ matrix.java }}
maven-version: 3.8.8
Expand Down
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,17 @@ after_success:
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
fi;
fi;
# publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
#- if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# cd website;
# git config --global user.name "${GH_NAME}";
# git config --global user.email "${GH_EMAIL}";
# echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc;
# yarn install;
# GIT_USER="${GH_NAME}" yarn run publish-gh-pages;
# fi;
publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
- if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
sed -i "s/Vector{UInt8}/Vector\{UInt8\}/g" docs/generators/julia-client.md
sed -i "s/Vector{UInt8}/Vector\{UInt8\}/g" docs/generators/julia-server.md
cd website;
git config --global user.name "${GH_NAME}";
git config --global user.email "${GH_EMAIL}";
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc;
yarn install;
GIT_USER="${GH_NAME}" yarn run publish-gh-pages;
fi;

env:
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div align="center">

[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.9.0`):
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.10.0`):
[![Build Status](https://api.travis-ci.com/OpenAPITools/openapi-generator.svg?branch=master&status=passed)](https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds)
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator)
Expand Down Expand Up @@ -129,7 +129,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20

| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.9.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.9.0-SNAPSHOT/) | 07.10.2024 | Minor release with breaking changes (with fallback) |
| 7.10.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/7.10.0-SNAPSHOT/) | 07.11.2024 | Minor release with breaking changes (with fallback) |
| [7.9.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.9.0) (latest stable release) | 07.10.2024 | Minor release with breaking changes (with fallback) |
| [7.8.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.8.0) (latest stable release) | 19.08.2024 | Minor release with breaking changes (with fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
Expand Down Expand Up @@ -193,16 +194,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):

JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar`

For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar -O openapi-generator-cli.jar
```

For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar
```

After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
Expand Down Expand Up @@ -437,7 +438,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"

```sh
openapi-generator-cli version-manager set 7.8.0
openapi-generator-cli version-manager set 7.9.0
```

Or install it as dev-dependency:
Expand All @@ -464,7 +465,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)

<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar)
<!-- /RELEASE_VERSION -->

To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions docs/generators/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<li>if</li>
<li>inline</li>
<li>int</li>
<li>linux</li>
<li>long</li>
<li>mutable</li>
<li>namespace</li>
Expand Down
8 changes: 4 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
To install a specific version of the tool, pass the version during installation:
<!-- RELEASE_VERSION -->
```bash
openapi-generator-cli version-manager set 7.8.0
openapi-generator-cli version-manager set 7.9.0
```
<!-- /RELEASE_VERSION -->
To install the tool as a dev dependency in your current project:
Expand Down Expand Up @@ -103,18 +103,18 @@ docker run --rm \
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):

JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar`

For **Mac/Linux** users:

```bash
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar -O openapi-generator-cli.jar
```

For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.

```powershell
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.8.0/openapi-generator-cli-7.8.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.9.0/openapi-generator-cli-7.9.0.jar
```
<!-- /RELEASE_VERSION -->

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.8.0</version>
<version>7.9.0</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-gradle-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.9.0-SNAPSHOT
openApiGeneratorVersion=7.10.0-SNAPSHOT
# /RELEASE_VERSION

# BEGIN placeholders
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-gradle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.9.0-SNAPSHOT
openApiGeneratorVersion=7.10.0-SNAPSHOT
# /RELEASE_VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-maven-plugin/examples/kotlin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-maven-plugin/examples/spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator-online/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion modules/openapi-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.9.0-SNAPSHOT</version>
<version>7.10.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ protected void setAddProps(Schema schema, IJsonSchemaValidationProperties proper
additionalPropertiesIsAnyType = true;
}
} else {
// if additioanl properties is set (e.g. free form object, any type, string, etc)
// if additional properties is set (e.g. free form object, any type, string, etc)
addPropProp = fromProperty(getAdditionalPropertiesName(), (Schema) schema.getAdditionalProperties(), false);
additionalPropertiesIsAnyType = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ public CLibcurlClientCodegen() {
// VC++ reserved keywords
"stdin",
"stdout",
"stderr")
"stderr",

// gcc predefined macros
"linux"
)
);

instantiationTypes.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,8 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
Optional<DataExtractSubstituteParameter> dataExtract = getDataExtractSubstituteParameter(
dataExtractSubstituteParams, operationId);

// calculate order for this current request
Integer requestOrder = calculateRequestOrder(operationGroupingOrder, requests.size());

requests.put(requestOrder, new HTTPRequest(
// create requests
requests.putIfAbsent(requests.size(), new HTTPRequest(
operationId,
method.toString().toLowerCase(Locale.ROOT),
path,
Expand Down Expand Up @@ -933,7 +931,7 @@ private void addOrUpdateRequestGroup(Map<String, HTTPRequestGroup> requestGroups
existingHTTPRequestGroup.addRequests(requests);
existingHTTPRequestGroup.addVariables(variables);
} else {
requestGroups.put(groupName, new HTTPRequestGroup(groupName, variables, requests));
requestGroups.putIfAbsent(groupName, new HTTPRequestGroup(groupName, variables, requests));
}
}

Expand Down Expand Up @@ -1127,36 +1125,6 @@ private void extractRequestBodyExample(RequestBody requestBody, String contentTy
}
}

/**
* Calculate order for this current request
*
* @param operationGroupingOrder
* @param requestsSize
* @return request order
*/
private Integer calculateRequestOrder(OptionalInt operationGroupingOrder, int requestsSize) {
int requestOrder;

if (operationGroupingOrder.isPresent()) {
requestOrder = operationGroupingOrder.getAsInt() - 1;

} else {
switch (requestsSize) {
case 0:
case 1:
requestOrder = requestsSize;
break;

default:
requestOrder = (requestsSize - 1);
break;
}
}

return requestOrder;
}

//

/**
* Any variables not defined yet but used for subsequent data extraction must be
Expand Down
Loading

0 comments on commit cbc0774

Please sign in to comment.