-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Jersey2 supports additional properties with composed schema #6523
Merged
wing328
merged 94 commits into
OpenAPITools:jersey2-improvement
from
CiscoM31:jersey2-supportsAdditionalPropertiesWithComposedSchema
Jun 5, 2020
+869
−286
Merged
Changes from 83 commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
41e97e6
Mustache template should use invokerPackage tag to generate import
sebastien-rosset 1760f6a
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 3ae466e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset b628667
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 4dc915c
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 7a207f6
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 776fba6
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 3fac434
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset a96c46b
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 1351fd0
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset ba65735
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 9a0b89e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 4c84190
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 94ae683
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset aac9f5a
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 93baa3d
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 5c313b4
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset cda8898
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 1f7e5c1
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset bef435e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset a9cad38
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 877ecfe
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 8c055f5
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset d64f421
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 4d0edfe
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset afeb701
fix typo, fix script issue, add log statement for troubleshooting
sebastien-rosset ed5c165
Add java jersey2 samples with OpenAPI doc that has HTTP signature sec…
sebastien-rosset 7edcb06
Add sample for Java jersey2 and HTTP signature scheme
sebastien-rosset 762bdb7
Add unit test for oneOf schema deserialization
sebastien-rosset c2c6364
Add unit test for oneOf schema deserialization
sebastien-rosset 4b0d0ca
Add log statements
sebastien-rosset 65076bb
Add profile for jersey2
sebastien-rosset 60f98e1
Temporarily disable unit test
sebastien-rosset 352497b
Temporarily disable unit test
sebastien-rosset 476eb01
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 40bb8d9
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset d227993
support for discriminator in jersey2
sebastien-rosset 8ff6088
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 05d8718
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset ac1a061
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset aa27b72
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset 22e6737
fix typo in pom.xml
sebastien-rosset 1971f7d
Merge branch 'jersey2-misc-enhancements' of github.com:CiscoM31/opena…
sebastien-rosset 90327fe
disable unit test because jersey2 deserialization is broken
sebastien-rosset 5c52b6b
disable unit test because jersey2 deserialization is broken
sebastien-rosset 38b8568
fix duplicate jersey2 samples
sebastien-rosset efec5a8
fix duplicate jersey2 samples
sebastien-rosset b3b4108
Merge branch 'jersey2-misc-enhancements' of github.com:CiscoM31/opena…
sebastien-rosset fac4991
Add code comments
sebastien-rosset 057f1ca
fix duplicate artifact id
sebastien-rosset e94c5c8
fix duplicate jersey2 samples
sebastien-rosset 99db107
run samples scripts
sebastien-rosset 9671045
Merge branch 'jersey2-misc-enhancements' of github.com:CiscoM31/opena…
sebastien-rosset 8579966
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 61e947e
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset 1cb05de
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset 20bd342
Merge branch 'jersey2-misc-enhancements' of github.com:CiscoM31/opena…
sebastien-rosset 7c45925
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset cc61ec5
merge from master
sebastien-rosset cb6884c
resolve merge conflicts
sebastien-rosset 7f52a53
Merge remote-tracking branch 'upstream/master'
vvb c123c91
Add unit tests
sebastien-rosset 76d3348
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 797e779
Merge branch 'master' of github.com:CiscoM31/openapi-generator
sebastien-rosset 3de8598
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset e7cc55d
fix unit tests
sebastien-rosset 163e738
continue implementation of discriminator lookup
sebastien-rosset 797f518
throw deserialization exception when value is null and schema does no…
sebastien-rosset 3752652
continue implementation of compose schema
sebastien-rosset e00545e
continue implementation of compose schema
sebastien-rosset 700e0f9
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 8fa6f2b
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset 4753db4
continue implementation of compose schema
sebastien-rosset 410a19d
Add more unit tests
sebastien-rosset 45c10e1
Add unit tests for anyOf
sebastien-rosset 589bfb8
Add unit tests
sebastien-rosset cf45a86
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset f3b8c05
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset c66892e
Set supportsAdditionalPropertiesWithComposedSchema to true for Java j…
sebastien-rosset effd1d3
Support additional properties as nested field
sebastien-rosset 71b8497
Support additional properties as nested field
sebastien-rosset 0b6291c
add code comments
sebastien-rosset cf845f5
add customer deserializer
sebastien-rosset ad3fa7e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset fa6cea1
Fix 'method too big' error with generated code
sebastien-rosset aa79612
resolve merge conflicts
sebastien-rosset 7e469f6
resolve merge conflicts
sebastien-rosset 12ecf34
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset d48a29a
Merge branch 'jersey2-method-too-big' of github.com:CiscoM31/openapi-…
sebastien-rosset 6321dfc
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset ae8e870
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset d1f351b
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset 7e2868b
Merge branch 'master' of github.com:CiscoM31/openapi-generator into j…
sebastien-rosset 2bab4c6
Merge branch 'jersey2-improvement' of https://github.com/OpenAPITools…
sebastien-rosset 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
313 changes: 282 additions & 31 deletions
313
CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wing328 , this is the code that has the |
||
* 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}} |
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.
@wing328 , this code avoids having the generated class extends from HashMap<String, T>. Instead, a
additionalProperties
field is added.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.
@sebastien-rosset I may have a better way for this. Let's have a chat via Slack today.