-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java Spring OAS3] Minor fixes and general improvements (#11229)
* * Use Relative Imports for org.springframework.core.io.Resource * api.mustache: Add operationId to atOperation annotation * Overhaul atSchema annotation in model * Add spring-stubs-oas3.yaml test config * Optimize mustache templates * Use Relative Imports for DateTimeFormat, Pageable and ApiIgnore * Add spring-stubs-oas3.yaml test config * Generate all samples * Explain fromOperation override to support more logic-less templates. * Support RootUriTemplateHandler from spring-boot * Revert "Support RootUriTemplateHandler from spring-boot" This reverts commit 1915f8b. * Evaluate additional property useSpringfox as Boolean * Generate all samples after merge (java-camel) * Fix typo * Move java-camel test deom samples.circleci.spring to samples.circleci profile. * re-generate all samples after merge * Generate samples and docs after merge * Generate samples after merge conflicts resolved
- Loading branch information
1 parent
e477538
commit 0f6b620
Showing
1,609 changed files
with
14,268 additions
and
14,523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
generatorName: spring | ||
outputDir: samples/openapi3/client/petstore/spring-stubs | ||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring | ||
additionalProperties: | ||
groupId: org.openapitools.openapi3 | ||
artifactId: spring-stubs | ||
oas3: "true" | ||
interfaceOnly: "true" | ||
singleContentTypes: "true" | ||
hideGenerationTimestamp: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...es/openapi-generator/src/main/resources/JavaSpring/additionalEnumTypeAnnotations.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
{{#additionalEnumTypeAnnotations}}{{{.}}} | ||
{{#additionalEnumTypeAnnotations}} | ||
{{{.}}} | ||
{{/additionalEnumTypeAnnotations}} |
3 changes: 2 additions & 1 deletion
3
...s/openapi-generator/src/main/resources/JavaSpring/additionalModelTypeAnnotations.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
{{#additionalModelTypeAnnotations}}{{{.}}} | ||
{{#additionalModelTypeAnnotations}} | ||
{{{.}}} | ||
{{/additionalModelTypeAnnotations}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
modules/openapi-generator/src/main/resources/JavaSpring/apiException.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/JavaSpring/apiResponseMessage.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 1 addition & 6 deletions
7
modules/openapi-generator/src/main/resources/JavaSpring/beanValidation.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
{{#required}} | ||
@NotNull | ||
{{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}} | ||
@Valid{{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}} | ||
@Valid{{/isPrimitiveType}}{{/isContainer}} | ||
{{>beanValidationCore}} | ||
{{#required}}@NotNull {{/required}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}@Valid {{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}@Valid {{/isPrimitiveType}}{{/isContainer}}{{>beanValidationCore}} |
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/JavaSpring/dateTimeParam.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} | ||
{{#isDate}} @DateTimeFormat(iso = DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/JavaSpring/generatedAnnotation.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@javax.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) | ||
@Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...napi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
modules/openapi-generator/src/main/resources/JavaSpring/notFoundException.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package {{apiPackage}}; | ||
|
||
import javax.annotation.Generated; | ||
|
||
{{>generatedAnnotation}} | ||
public class NotFoundException extends ApiException { | ||
private int code; | ||
public NotFoundException (int code, String msg) { | ||
super(code, msg); | ||
this.code = code; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.