Skip to content

Commit 0252f31

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/remove-unused-normalizer
2 parents 5078277 + 88bba25 commit 0252f31

805 files changed

Lines changed: 53509 additions & 14970 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ nb-configuration.xml
4949
*.xml~
5050
*.t~
5151

52+
**/.angular
53+
5254
/target
5355
/generated-files
5456
test-output/

CI/circle_parallel.sh

Lines changed: 7 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,15 @@ export NODE_ENV=test
1111

1212
if [ "$NODE_INDEX" = "1" ]; then
1313
echo "Running node $NODE_INDEX ..."
14-
java -version
1514

1615
sudo apt-get -y install cpanminus
1716

18-
# install rust
19-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
20-
source "$HOME/.cargo/env"
21-
2217
echo "Testing perl"
2318
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
2419

25-
echo "Testing ruby"
26-
(cd samples/client/petstore/ruby && mvn integration-test)
27-
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
28-
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
29-
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
30-
31-
echo "Testing rust"
32-
(cd samples/server/petstore/rust-axum && mvn integration-test)
3320

3421
elif [ "$NODE_INDEX" = "2" ]; then
35-
echo "Running node $NODE_INDEX to test Go"
36-
# install haskell
37-
#curl -sSLk https://get.haskellstack.org/ | sh
38-
#stack upgrade
39-
#stack --version
40-
41-
# install curl
42-
#sudo apt-get -y build-dep libcurl4-gnutls-dev
43-
#sudo apt-get -y install libcurl4-gnutls-dev
44-
45-
# Install golang version 1.18
46-
go version
47-
sudo mkdir /usr/local/go1.18
48-
wget -c https://dl.google.com/go/go1.18.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.18
49-
export PATH="/usr/local/go1.18/go/bin:$PATH"
50-
go version
22+
echo "Running node $NODE_INDEX to test cpp-restsdk"
5123

5224
# install cpprestsdk
5325
sudo apt-get install libcpprest-dev
@@ -62,54 +34,15 @@ elif [ "$NODE_INDEX" = "3" ]; then
6234

6335
echo "Running node $NODE_INDEX ... "
6436

65-
## Install node@stable (for angular 6)
66-
#set +e
67-
#curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
68-
#export NVM_DIR="/opt/circleci/.nvm"
69-
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
70-
##nvm install stable
71-
## install v16 instead of the latest stable version
72-
#nvm install 18
73-
#nvm alias default 18
74-
#node --version
75-
76-
## Each step uses the same `$BASH_ENV`, so need to modify it
77-
#echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
78-
#echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
79-
80-
#(cd samples/client/others/typescript-angular && mvn integration-test)
81-
#(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
82-
#(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
83-
#(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
84-
#(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
85-
#(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
86-
#(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
87-
#(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
88-
#(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
89-
#(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
90-
#(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
91-
#(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
92-
#(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
93-
#(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
94-
#(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
95-
#(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
96-
#(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
97-
##(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
98-
#(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
99-
#(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
100-
#(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
101-
#(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
102-
#(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
103-
#(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
104-
#(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
105-
#(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
106-
#(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
107-
#(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
108-
#(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
109-
#(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
37+
echo "Testing ruby"
38+
(cd samples/client/petstore/ruby && mvn integration-test)
39+
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
40+
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
41+
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
11042

11143
else
11244
echo "Running node $NODE_INDEX ..."
11345
java -version
46+
./mvnw clean install
11447

11548
fi

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ id: generators
33
title: Generators List
44
---
55

6+
[main] INFO o.o.c.l.PythonFastAPIServerCodegen - Skipping sorting of path operations, order matters, let the developer decide via their specification file.
67
The following generators are available:
78

89
## CLIENT generators

docs/generators/typescript-axios.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4444
|supportsES6|Generate code that conforms to ES6.| |false|
4545
|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|
4646
|useSquareBracketsInArrayNames|Setting this property to true will add brackets to array attribute names, e.g. my_values[].| |false|
47+
|withAWSV4Signature|whether to include AWS v4 signature support| |false|
4748
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
4849
|withNodeImports|Setting this property to true adds imports for NodeJS| |false|
4950
|withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes. This requires in addition a value for 'apiPackage' and 'modelPackage'| |false|
@@ -291,7 +292,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
291292
|OAuth2_ClientCredentials|✗|OAS2,OAS3
292293
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
293294
|SignatureAuth|✗|OAS3
294-
|AWSV4Signature||ToolingExtension
295+
|AWSV4Signature||ToolingExtension
295296

296297
### Wire Format Feature
297298
| Name | Supported | Defined By |

modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/GenerateBatch.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import io.airlift.airline.Command;
3030
import io.airlift.airline.Option;
3131
import org.apache.commons.io.FileUtils;
32+
import org.apache.commons.lang3.Strings;
3233
import org.apache.commons.lang3.StringUtils;
3334
import org.openapitools.codegen.ClientOptInput;
3435
import org.openapitools.codegen.CodegenConfig;
@@ -248,7 +249,7 @@ private void cleanPreviousFiles(final String name, Path outDir) throws IOExcepti
248249
Path filesMeta = Paths.get(outDir.toAbsolutePath().toString(), ".openapi-generator", "FILES");
249250
if (filesMeta.toFile().exists()) {
250251
FileUtils.readLines(filesMeta.toFile(), StandardCharsets.UTF_8).forEach(relativePath -> {
251-
if (!StringUtils.startsWith(relativePath, ".")) {
252+
if (!Strings.CS.startsWith(relativePath, ".")) {
252253
Path file = outDir.resolve(relativePath).toAbsolutePath();
253254
// hack: disallow directory traversal outside of output directory. we don't want to delete wrong files.
254255
if (file.toString().startsWith(outDir.toAbsolutePath().toString())) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5734,7 +5734,7 @@ private CodegenSecurity defaultCodegenSecurity(String key, SecurityScheme securi
57345734
cs.name = key;
57355735
cs.description = securityScheme.getDescription();
57365736
cs.type = securityScheme.getType().toString();
5737-
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = false;
5737+
cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = cs.isOpenId = cs.isOAuth = false;
57385738
cs.isHttpSignature = false;
57395739
cs.isBasicBasic = cs.isBasicBearer = false;
57405740
cs.scheme = securityScheme.getScheme();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ public String getTypeDeclaration(Schema p) {
16281628
Schema<?> target = ModelUtils.isGenerateAliasAsModel() ? p : schema;
16291629
if (ModelUtils.isArraySchema(target)) {
16301630
Schema<?> items = getSchemaItems(schema);
1631-
return getSchemaType(target) + "<" + getTypeDeclarationForArray(items) + ">";
1631+
return typeMapping.get("array") + "<" + getTypeDeclarationForArray(items) + ">";
16321632
} else if (ModelUtils.isMapSchema(p)) {
16331633
// Should we also support maps of maps?
16341634
Schema<?> inner = ModelUtils.getAdditionalProperties(p);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import io.swagger.v3.oas.models.parameters.Parameter;
3535
import io.swagger.v3.oas.models.parameters.RequestBody;
3636
import io.swagger.v3.oas.models.security.SecurityScheme;
37+
import org.apache.commons.lang3.Strings;
3738
import org.apache.commons.lang3.StringUtils;
3839
import org.openapitools.codegen.*;
3940
import org.openapitools.codegen.meta.features.DocumentationFeature;
@@ -601,7 +602,7 @@ public String packagePath() {
601602
@Override
602603
public String toModelImport(String name) {
603604
String modelImport;
604-
if (StringUtils.startsWithAny(name, "import", "from")) {
605+
if (Strings.CS.startsWithAny(name, "import", "from")) {
605606
modelImport = name;
606607
} else {
607608
modelImport = "from ";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import io.swagger.v3.oas.models.media.Schema;
2121
import io.swagger.v3.oas.models.security.SecurityScheme;
2222
import lombok.Setter;
23-
import org.apache.commons.lang3.StringUtils;
23+
import org.apache.commons.lang3.Strings;
2424
import org.openapitools.codegen.*;
2525
import org.openapitools.codegen.meta.GeneratorMetadata;
2626
import org.openapitools.codegen.meta.Stability;
@@ -355,7 +355,7 @@ public boolean getUseOneOfDiscriminatorLookup() {
355355
@Override
356356
public String toModelImport(String name) {
357357
String modelImport;
358-
if (StringUtils.startsWithAny(name, "import", "from")) {
358+
if (Strings.CS.startsWithAny(name, "import", "from")) {
359359
modelImport = name;
360360
} else {
361361
modelImport = "from ";

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.fasterxml.jackson.databind.SerializerProvider;
2424
import com.fasterxml.jackson.databind.module.SimpleModule;
2525
import io.swagger.v3.oas.models.media.Schema;
26+
import org.apache.commons.lang3.Strings;
2627
import org.apache.commons.lang3.StringUtils;
2728
import org.openapitools.codegen.*;
2829
import org.openapitools.codegen.meta.GeneratorMetadata;
@@ -89,6 +90,11 @@ public String getHelp() {
8990
public PythonFastAPIServerCodegen() {
9091
super();
9192

93+
// Skip sorting of operations to preserve the order found in the OpenAPI spec file. See
94+
// https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters.
95+
LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file.");
96+
setSkipSortingOperations(true);
97+
9298
modifyFeatureSet(features -> features.includeSecurityFeatures(
9399
SecurityFeature.OAuth2_AuthorizationCode,
94100
SecurityFeature.OAuth2_Password
@@ -198,7 +204,7 @@ public String getName() {
198204
@Override
199205
public String toModelImport(String name) {
200206
String modelImport;
201-
if (StringUtils.startsWithAny(name, "import", "from")) {
207+
if (Strings.CS.startsWithAny(name, "import", "from")) {
202208
modelImport = name;
203209
} else {
204210
modelImport = "from ";

0 commit comments

Comments
 (0)