Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
CREKD127 committed May 9, 2024
2 parents 8cce74c + 4441ab3 commit 5872d73
Show file tree
Hide file tree
Showing 50 changed files with 5,173 additions and 3,138 deletions.
2 changes: 1 addition & 1 deletion bin/configs/jaxrs-spec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generatorName: jaxrs-spec
outputDir: samples/server/petstore/jaxrs-spec
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
additionalProperties:
artifactId: jaxrs-spec-petstore-server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,9 @@ public void processOpts() {
importMapping.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore");
importMapping.put("JsonIgnoreProperties", "com.fasterxml.jackson.annotation.JsonIgnoreProperties");
importMapping.put("JsonInclude", "com.fasterxml.jackson.annotation.JsonInclude");
importMapping.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable");
if (openApiNullable) {
importMapping.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable");
}
importMapping.put("SerializedName", "com.google.gson.annotations.SerializedName");
importMapping.put("TypeAdapter", "com.google.gson.TypeAdapter");
importMapping.put("JsonAdapter", "com.google.gson.annotations.JsonAdapter");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,14 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
}
if (operation.getParameters() != null) {
for (Parameter parameter : operation.getParameters()) {
if (StringUtils.isNotEmpty(parameter.get$ref())) {
parameter = ModelUtils.getReferencedParameter(openAPI, parameter);
}
String swaggerParameterName = parameter.getName();
String pythonParameterName = this.toParamName(swaggerParameterName);
if (swaggerParameterName == null) {
throw new RuntimeException("Please report the issue as the parameter name cannot be null: " + parameter);
}
if (!swaggerParameterName.equals(pythonParameterName)) {
LOGGER.warn(
"Parameter name '{}' is not consistent with Python variable names. It will be replaced by '{}'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@
<version>${beanvalidation-version}</version>
<scope>provided</scope>
</dependency>
{{/useBeanValidation}}
{{/useBeanValidation}}
{{#openApiNullable}}
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>
{{/openApiNullable}}
</dependencies>
<properties>
<java.version>1.8</java.version>
Expand Down Expand Up @@ -192,5 +199,8 @@
{{^useJakartaEe}}
<jakarta.ws.rs-version>2.1.6</jakarta.ws.rs-version>
{{/useJakartaEe}}
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{/openApiNullable}}
</properties>
</project>
Loading

0 comments on commit 5872d73

Please sign in to comment.