-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[Java][MicroProfile] Support additionalProperties with Jackson #21451
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
Merged
+5,685
−15
Merged
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions
12
bin/configs/java-microprofile-rest-client-3.0-jackson-mutiny.yaml
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,12 @@ | ||
| generatorName: java | ||
| outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny | ||
| library: microprofile | ||
| inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/Java | ||
| additionalProperties: | ||
| serializationLibrary: jackson | ||
| artifactId: microprofile-rest-client-3-jackson-mutiny | ||
| configKey: petstore | ||
| microprofileRestClientVersion: "3.0" | ||
| microprofileMutiny: true | ||
| hideGenerationTimestamp: true | ||
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
45 changes: 45 additions & 0 deletions
45
...i-generator/src/main/resources/Java/libraries/microprofile/additional_properties.mustache
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,45 @@ | ||
| {{#additionalPropertiesType}} | ||
| /** | ||
| * A container for additional, undeclared properties. | ||
| * This is a holder for any undeclared properties as specified with | ||
| * the 'additionalProperties' keyword in the OAS document. | ||
| */ | ||
| private Map<String, {{{.}}}> additionalProperties; | ||
|
|
||
| /** | ||
| * Set the additional (undeclared) property with the specified name and value. | ||
| * If the property does not already exist, create it otherwise replace it. | ||
| * @param key the name of the property | ||
| * @param value the value of the property | ||
| * @return self reference | ||
| */ | ||
| @com.fasterxml.jackson.annotation.JsonAnySetter | ||
| public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { | ||
| if (this.additionalProperties == null) { | ||
| this.additionalProperties = new HashMap<String, {{{.}}}>(); | ||
| } | ||
| this.additionalProperties.put(key, value); | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Return the additional (undeclared) properties. | ||
| * @return the additional (undeclared) properties | ||
| */ | ||
| @com.fasterxml.jackson.annotation.JsonAnyGetter | ||
| public Map<String, {{{.}}}> getAdditionalProperties() { | ||
| return additionalProperties; | ||
| } | ||
|
|
||
| /** | ||
| * Return the additional (undeclared) property with the specified name. | ||
| * @param key the name of the property | ||
| * @return the additional (undeclared) property with the specified name | ||
| */ | ||
| public {{{.}}} getAdditionalProperty(String key) { | ||
| if (this.additionalProperties == null) { | ||
| return null; | ||
| } | ||
| return this.additionalProperties.get(key); | ||
| } | ||
| {{/additionalPropertiesType}} |
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
23 changes: 23 additions & 0 deletions
23
...lient/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/.openapi-generator-ignore
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,23 @@ | ||
| # OpenAPI Generator Ignore | ||
| # Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
|
||
| # Use this file to prevent files from being overwritten by the generator. | ||
| # The patterns follow closely to .gitignore or .dockerignore. | ||
|
|
||
| # As an example, the C# client generator defines ApiClient.cs. | ||
| # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
| #ApiClient.cs | ||
|
|
||
| # You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
| #foo/*/qux | ||
| # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
|
||
| # You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
| #foo/**/qux | ||
| # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
|
||
| # You can also negate patterns with an exclamation (!). | ||
| # For example, you can ignore all files in a docs folder with the file extension .md: | ||
| #docs/*.md | ||
| # Then explicitly reverse the ignore rule for a single file: | ||
| #!docs/README.md |
25 changes: 25 additions & 0 deletions
25
...client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/.openapi-generator/FILES
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,25 @@ | ||
| README.md | ||
| docs/Category.md | ||
| docs/ModelApiResponse.md | ||
| docs/Order.md | ||
| docs/Pet.md | ||
| docs/PetApi.md | ||
| docs/StoreApi.md | ||
| docs/Tag.md | ||
| docs/User.md | ||
| docs/UserApi.md | ||
| pom.xml | ||
| src/main/java/org/openapitools/client/RFC3339DateFormat.java | ||
| src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java | ||
| src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java | ||
| src/main/java/org/openapitools/client/api/ApiException.java | ||
| src/main/java/org/openapitools/client/api/ApiExceptionMapper.java | ||
| src/main/java/org/openapitools/client/api/PetApi.java | ||
| src/main/java/org/openapitools/client/api/StoreApi.java | ||
| src/main/java/org/openapitools/client/api/UserApi.java | ||
| src/main/java/org/openapitools/client/model/Category.java | ||
| src/main/java/org/openapitools/client/model/ModelApiResponse.java | ||
| src/main/java/org/openapitools/client/model/Order.java | ||
| src/main/java/org/openapitools/client/model/Pet.java | ||
| src/main/java/org/openapitools/client/model/Tag.java | ||
| src/main/java/org/openapitools/client/model/User.java |
1 change: 1 addition & 0 deletions
1
...ient/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/.openapi-generator/VERSION
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 @@ | ||
| 7.15.0-SNAPSHOT |
9 changes: 9 additions & 0 deletions
9
samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/README.md
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,9 @@ | ||
| # OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server | ||
|
|
||
| This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. | ||
|
|
||
| ## Overview | ||
| This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. | ||
| [MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling | ||
| REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. | ||
|
|
15 changes: 15 additions & 0 deletions
15
...ient/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/docs/Category.md
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 @@ | ||
|
|
||
|
|
||
| # Category | ||
|
|
||
| A category for a pet | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**id** | **Long** | | [optional] | | ||
| |**name** | **String** | | [optional] | | ||
|
|
||
|
|
||
|
|
16 changes: 16 additions & 0 deletions
16
...store/java/microprofile-rest-client-3.0-jackson-mutiny/docs/ModelApiResponse.md
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,16 @@ | ||
|
|
||
|
|
||
| # ModelApiResponse | ||
|
|
||
| Describes the result of uploading an image resource | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**code** | **Integer** | | [optional] | | ||
| |**type** | **String** | | [optional] | | ||
| |**message** | **String** | | [optional] | | ||
|
|
||
|
|
||
|
|
29 changes: 29 additions & 0 deletions
29
.../client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/docs/Order.md
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,29 @@ | ||
|
|
||
|
|
||
| # Order | ||
|
|
||
| An order for a pets from the pet store | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**id** | **Long** | | [optional] | | ||
| |**petId** | **Long** | | [optional] | | ||
| |**quantity** | **Integer** | | [optional] | | ||
| |**shipDate** | **Date** | | [optional] | | ||
| |**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | | ||
| |**complete** | **Boolean** | | [optional] | | ||
|
|
||
|
|
||
|
|
||
| ## Enum: StatusEnum | ||
|
|
||
| | Name | Value | | ||
| |---- | -----| | ||
| | PLACED | "placed" | | ||
| | APPROVED | "approved" | | ||
| | DELIVERED | "delivered" | | ||
|
|
||
|
|
||
|
|
29 changes: 29 additions & 0 deletions
29
...es/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny/docs/Pet.md
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,29 @@ | ||
|
|
||
|
|
||
| # Pet | ||
|
|
||
| A pet for sale in the pet store | ||
|
|
||
| ## Properties | ||
|
|
||
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**id** | **Long** | | [optional] | | ||
| |**category** | [**Category**](Category.md) | | [optional] | | ||
| |**name** | **String** | | | | ||
| |**photoUrls** | **List<String>** | | | | ||
| |**tags** | [**List<Tag>**](Tag.md) | | [optional] | | ||
| |**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | | ||
|
|
||
|
|
||
|
|
||
| ## Enum: StatusEnum | ||
|
|
||
| | Name | Value | | ||
| |---- | -----| | ||
| | AVAILABLE | "available" | | ||
| | PENDING | "pending" | | ||
| | SOLD | "sold" | | ||
|
|
||
|
|
||
|
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about adding this to the github workflow so that it will be tested moving forward?
https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-java-client-jdk11.yaml