forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: OpenAPITools#1466 additionalProperties works now in spring gener…
…ator (OpenAPITools#11572) (fix OpenAPITools#1466) * fix: OpenAPITools#1466 additionalProperties works now in spring generator * chore: chore: OpenAPITools#1466 solved rebase conflicts * 1466; updated samples * [Spring] update additionalProperties MR * [Spring] additionalProperties unit test --------- Co-authored-by: Your Name <[email protected]> Co-authored-by: Oleh Kurpiak <[email protected]>
- Loading branch information
Showing
199 changed files
with
6,265 additions
and
853 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
39 changes: 39 additions & 0 deletions
39
modules/openapi-generator/src/main/resources/JavaSpring/additionalProperties.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{#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. | ||
*/ | ||
@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) property. | ||
*/ | ||
@JsonAnyGetter | ||
public Map<String, {{{.}}}> getAdditionalProperties() { | ||
return additionalProperties; | ||
} | ||
|
||
/** | ||
* 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 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
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
Oops, something went wrong.