-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Correct generation of additionalProperties Map for numerous Java libraries (issue #20139) #21229
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
DavidGrath
wants to merge
6
commits into
OpenAPITools:master
Choose a base branch
from
DavidGrath:issue-20139
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.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6fedd29
Fixed issue #20139 with additionalProperties in the Java Client
DavidGrath bd5eb98
Added Issue 20139 test for Spring
DavidGrath a13798a
Regenerated samples
DavidGrath b61e603
Changed Apple and Banana to let petstore-openapi3-jersey2-java8 tests…
DavidGrath a3cdf7c
Re-trigger because of HTTP 503 on last job
DavidGrath 9144f83
Merge branch 'master' into issue-20139
DavidGrath 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
23 changes: 23 additions & 0 deletions
23
modules/openapi-generator/src/test/resources/2_0/issue_20139.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,23 @@ | ||
swagger: '2.0' | ||
info: | ||
version: '1.0' | ||
title: FooBar | ||
paths: | ||
/jwks: | ||
get: | ||
operationId: getJwks | ||
responses: | ||
200: | ||
description: "Success" | ||
schema: | ||
type: "array" | ||
items: | ||
$ref: "#/definitions/JsonWebKey" | ||
definitions: | ||
JsonWebKey: | ||
title: JSON Web Key | ||
type: object | ||
properties: | ||
kid: | ||
type: string | ||
# No additionalProperties specified |
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
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
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.
Hi @DavidGrath thanks again for the PR.
My first question is it looks to me the if block is checking the schema type but your additional is not checking scheme type but rather an option (disallowAdditionalPropertiesIfNotPresent) ?
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 , yes, that is correct, my reasoning being that the property wasn't already considered in the if block already, so
addAdditionPropertiesToCodeGenModel
wouldn't have been called at all if it was false