Skip to content

Commit 929e5cb

Browse files
author
Andrew Wilson
authored
Merge branch 'master' into cashapp/protos
2 parents 059fdca + dcd9463 commit 929e5cb

474 files changed

Lines changed: 29108 additions & 30435 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.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ Here is a list of template creators:
11391139
* Kotlin (Spring Boot): @dr4ke616
11401140
* Kotlin (Vertx): @Wooyme
11411141
* Kotlin (JAX-RS): @anttileppa
1142-
* Kotlin Misk: @andrewwilsonnew
1142+
* Kotlin Misk: @andrewwilsonnew @guiarn
11431143
* Kotlin WireMock: @stefankoppier
11441144
* NodeJS Express: @YishTish
11451145
* PHP Flight: @daniel-sc
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
generatorName: rust-axum
2+
outputDir: samples/server/petstore/rust-axum/output/rust-axum-array-params-test
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/rust/rust-axum-array-params-test.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/rust-axum
5+
generateAliasAsModel: true
6+
additionalProperties:
7+
hideGenerationTimestamp: "true"
8+
packageName: rust-axum-array-params-test
9+
globalProperties:
10+
skipFormModel: false
11+
enablePostProcessFile: true

bin/configs/protobuf-schema-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ additionalProperties:
88
numberedFieldNumberList: true
99
startEnumsWithUnspecified: true
1010
wrapComplexType: false
11+
supportMultipleResponses: false
1112
aggregateModelsName: data
1213
typeMappings:
1314
object: "google.protobuf.Struct"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: typescript
2+
outputDir: samples/client/echo_api/typescript/build
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript
5+
additionalProperties:
6+
artifactId: echo-api-typescript
7+
hideGenerationTimestamp: "true"
8+
platform: node
9+
npmVersion: 1.0.0
10+
npmName: '@openapitools/typescript-echo-api'

docs/generators/protobuf-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2222
|aggregateModelsName|Aggregated model filename. If set, all generated models will be combined into this single file.| |null|
2323
|numberedFieldNumberList|Field numbers in order.| |false|
2424
|startEnumsWithUnspecified|Introduces "UNSPECIFIED" as the first element of enumerations.| |false|
25+
|supportMultipleResponses|Support multiple responses| |true|
2526
|wrapComplexType|Generate Additional message for complex type| |true|
2627

2728
## IMPORT MAPPING

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

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -454,29 +454,6 @@ public String escapeQuotationMark(String input) {
454454
return input.replace("\"", "\\\"");
455455
}
456456

457-
protected String escapeRegex(String pattern) {
458-
pattern = pattern.replaceAll("\\\\\\\\", "\\\\");
459-
pattern = pattern.replaceAll("^/", "");
460-
pattern = pattern.replaceAll("/$", "");
461-
return pattern;
462-
}
463-
464-
/**
465-
* Convert OpenAPI Parameter object to Codegen Parameter object
466-
*
467-
* @param imports set of imports for library/package/module
468-
* @param param OpenAPI parameter object
469-
* @return Codegen Parameter object
470-
*/
471-
@Override
472-
public CodegenParameter fromParameter(Parameter param, Set<String> imports) {
473-
CodegenParameter parameter = super.fromParameter(param, imports);
474-
if (parameter.pattern != null) {
475-
parameter.pattern = escapeRegex(parameter.pattern);
476-
}
477-
return parameter;
478-
}
479-
480457
/**
481458
* Convert OAS Property schema to Codegen Property object.
482459
* <p>
@@ -498,9 +475,6 @@ public CodegenProperty fromProperty(String name, Schema schema, boolean required
498475
if (needsVarEscape(property.name)) {
499476
property.name = "var\"" + property.name + "\"";
500477
}
501-
if (property.pattern != null) {
502-
property.pattern = escapeRegex(property.pattern);
503-
}
504478
return property;
505479
}
506480

@@ -531,6 +505,19 @@ private void changeParamNames(List<CodegenParameter> paramsList, HashSet<String>
531505
}
532506
}
533507

508+
@Override
509+
public String toRegularExpression(String pattern) {
510+
if (pattern == null) {
511+
return pattern;
512+
}
513+
514+
pattern = escapeText(pattern);
515+
// escapeText unnecessarily escapes `\` such that `\.` in the regex ends up as `\\.` for example.
516+
// we need to restore it back by converting `\\` to `\`
517+
pattern = pattern.replaceAll("\\\\\\\\", "\\\\");
518+
return pattern;
519+
}
520+
534521
/**
535522
* Convert OAS Operation object to Codegen Operation object
536523
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public String toDefaultValue(Schema p) {
214214
String defaultValue = String.valueOf(p.getDefault());
215215
if (defaultValue != null) {
216216
defaultValue = defaultValue.replace("\\", "\\\\")
217-
.replace("'", "\'");
217+
.replace("'", "\\'");
218218
if (Pattern.compile("\r\n|\r|\n").matcher(defaultValue).find()) {
219219
return "'''" + defaultValue + "'''";
220220
} else {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ public void processOpts() {
413413
setParamNaming((String) additionalProperties.get(CodegenConstants.PARAM_NAMING));
414414
}
415415

416-
setSupportsES6(convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6));
416+
if (additionalProperties.containsKey(CodegenConstants.SUPPORTS_ES6)) {
417+
setSupportsES6(convertPropertyToBooleanAndWriteBack(CodegenConstants.SUPPORTS_ES6));
418+
}
417419

418420
if (additionalProperties.containsKey(NULL_SAFE_ADDITIONAL_PROPS)) {
419421
setNullSafeAdditionalProps(Boolean.valueOf(additionalProperties.get(NULL_SAFE_ADDITIONAL_PROPS).toString()));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ public void processOpts() {
924924
addSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir, authPackageDir);
925925
supportingFiles.add(new SupportingFile("ConnectionException.mustache", clientPackageDir, "ConnectionException.cs"));
926926
supportingFiles.add(new SupportingFile("UnexpectedResponseException.mustache", clientPackageDir, "UnexpectedResponseException.cs"));
927+
supportingFiles.add(new SupportingFile("UnityWebRequestAwaiterExtension.mustache", clientPackageDir, "UnityWebRequestAwaiterExtension.cs"));
927928
break;
928929
default: // generichost
929930
addGenericHostSupportingFiles(clientPackageDir, packageFolder, excludeTests, testPackageFolder, testPackageName, modelPackageDir);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ public class ElixirClientCodegen extends DefaultCodegen {
5757
// This is the name of elixir project name;
5858
protected static final String defaultPackageName = "openapi_client";
5959

60-
String supportedElixirVersion = "1.10";
60+
String supportedElixirVersion = "1.18";
6161
List<String> extraApplications = Arrays.asList(":logger");
6262
List<String> deps = Arrays.asList(
6363
"{:tesla, \"~> 1.7\"}",
64-
"{:jason, \"~> 1.4\"}",
6564
"{:ex_doc, \"~> 0.30\", only: :dev, runtime: false}",
6665
"{:dialyxir, \"~> 1.3\", only: [:dev, :test], runtime: false}");
6766

@@ -694,7 +693,7 @@ public String codeMappingKey() {
694693
}
695694

696695
public String decodedStruct() {
697-
// Let Jason decode the entire response into a generic blob
696+
// Decode the entire response into a generic blob
698697
if (isMap) {
699698
return "%{}";
700699
}

0 commit comments

Comments
 (0)