-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[JAVA-SPRING;KOTLIN-SPRING] - add possibility to override x-implements and x-kotlin-implements via config options. #22839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Picazsoo
wants to merge
22
commits into
OpenAPITools:master
Choose a base branch
from
Picazsoo:feat/x-implements-overrides
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16,388
−845
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
607427d
feature/add-skip-x-implements
Picazsoo 4280681
feature/add-skip-x-implements
Picazsoo 221f05a
feature/add-x-implements-overrides support in tooling
Picazsoo 681aabf
add basic unit test for x-implements and x-implements-overrides
Picazsoo f17b647
add implementation and unit test for schemaImplements
Picazsoo d45c293
add "java.io.Serializable" directly via x-kotlin-implements
Picazsoo 039606d
add schemaImplements and schemaImplementsFields support to kotlin-spring
Picazsoo 05808ea
add xImplementsSkip additional property
Picazsoo 1597304
add xKotlinImplementsSkip and xKotlinImplementsFieldsSkip additional …
Picazsoo 86def9a
add unit tests
Picazsoo 0869730
add documentation
Picazsoo fdb48bf
commit changes and add missing interface
Picazsoo 02dbf12
add documentation
Picazsoo bdb2447
Merge branch 'refs/heads/master' into feat/x-implements-overrides
Picazsoo 90de5ed
add output to samples
Picazsoo eedb60e
change logs
Picazsoo 7b99690
fix issue #22756
Picazsoo cfcbda5
revert unrelated formatting changes
Picazsoo 46fdca7
nudge test rerun
Picazsoo 55e519a
implement feedback from CR
Picazsoo 67dd492
check compilation success
Picazsoo 9d6f082
fix interfaces
Picazsoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,15 @@ | ||
| generatorName: spring | ||
| outputDir: samples/server/petstore/springboot-x-implements-skip | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/JavaSpring | ||
| additionalProperties: | ||
| documentationProvider: springfox | ||
| artifactId: springboot | ||
| snapshotVersion: "true" | ||
| hideGenerationTimestamp: "true" | ||
| camelCaseDollarSign: "true" | ||
| modelNameSuffix: 'Dto' | ||
| xImplementsSkip: [ com.custompackage.InterfaceToSkip ] | ||
| schemaImplements: | ||
| Foo: [ com.custompackage.WithBar, com.custompackage.WithDefaultMethod ] | ||
| Animal: com.custompackage.WithColor |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | |
| |resourceFolder|resource folder for generated resources| |src/main/resources| | ||
| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| | ||
| |returnSuccessCode|Generated server returns 2xx code| |false| | ||
| |schemaImplements|Ability to supply interfaces per schema that should be implemented (serves similar purpose as vendor extension `x-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)| |empty map| | ||
| |scmConnection|SCM connection in generated pom.xml| |scm:git:[email protected]:openapitools/openapi-generator.git| | ||
| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:[email protected]:openapitools/openapi-generator.git| | ||
| |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| | ||
|
|
@@ -117,6 +118,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | |
| |useTags|use tags for creating interface and controller classnames| |false| | ||
| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| | ||
| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| | ||
| |xImplementsSkip|Ability to choose interfaces that should NOT be implemented in the models despite their presence in vendor extension `x-implements`. Takes a list of fully qualified interface names. Example: yaml `xImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface `com.some.pack.WithPhotoUrls` in any schema| |empty list| | ||
|
|
||
| ## SUPPORTED VENDOR EXTENSIONS | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | |
| |resourceFolder|resource folder for generated resources| |src/main/resources| | ||
| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| | ||
| |returnSuccessCode|Generated server returns 2xx code| |false| | ||
| |schemaImplements|Ability to supply interfaces per schema that should be implemented (serves similar purpose as vendor extension `x-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)| |empty map| | ||
| |scmConnection|SCM connection in generated pom.xml| |scm:git:[email protected]:openapitools/openapi-generator.git| | ||
| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:[email protected]:openapitools/openapi-generator.git| | ||
| |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| | ||
|
|
@@ -110,6 +111,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl | |
| |useTags|use tags for creating interface and controller classnames| |false| | ||
| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| | ||
| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| | ||
| |xImplementsSkip|Ability to choose interfaces that should NOT be implemented in the models despite their presence in vendor extension `x-implements`. Takes a list of fully qualified interface names. Example: yaml `xImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface `com.some.pack.WithPhotoUrls` in any schema| |empty list| | ||
|
|
||
| ## SUPPORTED VENDOR EXTENSIONS | ||
|
|
||
|
|
||
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.