-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[ALL][CLIENT] Fix serialization for query params specified by ref #11864
[ALL][CLIENT] Fix serialization for query params specified by ref #11864
Conversation
0619398
to
2f060f2
Compare
2f060f2
to
486e7cd
Compare
@wing328 pinging you again |
89c0ac8
to
fee81a3
Compare
Hi, Any update on this pull request? Would it be possible to add it to another upcoming Thanks and regards. |
fee81a3
to
1d2438b
Compare
@sorin-florea thanks for the PR. Please resolve the merge conflicts when you've time. |
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
Show resolved
Hide resolved
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java
Show resolved
Hide resolved
1d2438b
to
ef29bd6
Compare
Please also merge the latest master into your branch when you've time. Thank you. |
…-param-explode * origin/master: Add martindelille to code owners (OpenAPITools#12328) add tests to set httpUserAgent in r client (OpenAPITools#12321) better error messages for oneOf in java okhttp-gson (OpenAPITools#12311) [Inline model resolver] various improvements (OpenAPITools#12293)
@wing328 done. Can you please re-review it? |
@sorin-florea I tested with modules/openapi-generator/src/test/resources/3_0/issue907.yaml and noticed the following changes in openapi.yaml: diff --git a/api/openapi.yaml b/api/openapi.yaml
index 998b576..cba8256 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -17,12 +17,33 @@ paths:
schema:
type: string
style: simple
- - explode: true
+ - $ref: '#/components/schemas/BuildQuery'
+ explode: true
in: query
name: BuildQuery
required: false
schema:
- $ref: '#/components/schemas/BuildQuery'
+ properties:
+ integerProp:
+ format: int32
+ minimum: 0
+ type: integer
+ stringProp:
+ minLength: 1
+ type: string
+ booleanProp:
+ type: boolean
+ arrayProp:
+ items:
+ minLength: 1
+ type: string
+ type: array
+ objectProp:
+ type: object
+ numberProp:
+ minimum: 0
+ type: number
+ type: object
style: form
responses:
"200": In the past few days, we've merged a few PRs to improve the inline model resolver that are doing it the other way around by creating the inline schemas separately and referencing it instead. Can we keep $ref as it's instead expanding it into the actual schema? (I'm working on a PR to improve the inline model resolver so that inline schemas defined in the parameters are created separately and referenced using $ref instead) I'm free in the afternoon (next couple of hours) so feel free to DM me via Slack to discuss this further. Thanks again for the PR. Inline model resolver-related PRs merged recently: |
One more thing to add is that I don't see changes to the Java classes that fix the serialization for query parameter issue:
All the changes to the Java files are due to timestamps change, e.g. diff --git a/src/main/java/org/openapitools/client/model/BuildQuery.java b/src/main/java/org/openapitools/client/model/BuildQuery.java
index f6fd90d..518a520 100644
--- a/src/main/java/org/openapitools/client/model/BuildQuery.java
+++ b/src/main/java/org/openapitools/client/model/BuildQuery.java
@@ -50,7 +50,7 @@ import org.openapitools.client.JSON;
/**
* BuildQuery
*/
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-13T13:18:02.304890+08:00[Asia/Hong_Kong]")
+@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-05-13T13:21:16.933465+08:00[Asia/Hong_Kong]")
public class BuildQuery {
public static final String SERIALIZED_NAME_INTEGER_PROP = "integerProp";
@SerializedName(SERIALIZED_NAME_INTEGER_PROP) |
FYI. The issue is addressed by #12369 instead. |
As I see, the original PR from @sorin-florea was not merged. @wing328 could you please , instead of an incomprehensible link to another PR, somehow summarize the decision on this fix? Which version contains similar one? |
Fixes #907
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x