-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jersey2 supports additional properties with composed schema (#6523)
* Mustache template should use invokerPackage tag to generate import * fix typo, fix script issue, add log statement for troubleshooting * Add java jersey2 samples with OpenAPI doc that has HTTP signature security scheme * Add sample for Java jersey2 and HTTP signature scheme * Add unit test for oneOf schema deserialization * Add unit test for oneOf schema deserialization * Add log statements * Add profile for jersey2 * Temporarily disable unit test * Temporarily disable unit test * support for discriminator in jersey2 * fix typo in pom.xml * disable unit test because jersey2 deserialization is broken * disable unit test because jersey2 deserialization is broken * fix duplicate jersey2 samples * fix duplicate jersey2 samples * Add code comments * fix duplicate artifact id * fix duplicate jersey2 samples * run samples scripts * resolve merge conflicts * Add unit tests * fix unit tests * continue implementation of discriminator lookup * throw deserialization exception when value is null and schema does not allow null value * continue implementation of compose schema * continue implementation of compose schema * continue implementation of compose schema * Add more unit tests * Add unit tests for anyOf * Add unit tests * Set supportsAdditionalPropertiesWithComposedSchema to true for Java jersey2 * Support additional properties as nested field * Support additional properties as nested field * add code comments * add customer deserializer * Fix 'method too big' error with generated code * resolve merge conflicts Co-authored-by: Vikrant Balyan (vvb) <[email protected]>
- Loading branch information
1 parent
bbe7976
commit 1bcc917
Showing
138 changed files
with
869 additions
and
286 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
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
31 changes: 31 additions & 0 deletions
31
...penapi-generator/src/main/resources/Java/libraries/jersey2/additional_properties.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,31 @@ | ||
{{#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. | ||
*/ | ||
@JsonUnwrapped | ||
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. | ||
*/ | ||
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 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
Oops, something went wrong.