-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Single request parameter equals and hashcode #20833
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
Single request parameter equals and hashcode #20833
Conversation
d278cfa
to
ea453ba
Compare
The enum samples that are generated in the pipeline does not align with the samples can I get locally when running |
ea453ba
to
ffc3879
Compare
https://github.com/OpenAPITools/openapi-generator/actions/runs/13763475328/job/38484877323?pr=20833 please update the samples to fix the CI failure |
ffc3879
to
1a6fb0b
Compare
|
if no further question/feedback, i'll merge this PR later this week |
Please merge Mattias-Sehlstedt#1 into your branch. It adds the new restclient sample. |
add restclient sample
Thanks for the assistance martin. Would my issue be due to some misconfiguration on my end or is there some general misalignment that one has to account for? I have for example also seen on my end that I get a lot of sample changes tied to enum value examples when I generated the samples. But I manually exclude them since they are not present upstream? Seems like someone did an enum update a long while ago and missed to update the samples? |
I just tried locally and didn't get any sample changes. And the pipeline which checks whether samples are up to date is also green for your branch, so I seems to be an issue on your end.
No. The only not so obvious thing is that I had to mark the new generated |
Hi @wing328, will this make it into 7.13, or is the scope for that release already set? |
just merged it before v7.13.0 release thanks for the contribution |
I found the cause for this. It is tied to me using a Swedish locale, and hence losing the negative enum values as per the issue reported in swagger-api/swagger-core#4223. An example of a fix is to run |
Fixes #20829
I have added an equals and a hashcode implementation to the WebClient and the RestClient singleRequestParameter-model that is created when setting
useSingleRequestParameter
tostatic
.The implementation is taken from the one present in the POJO mustache files, so it might be that the vendor-extension
x-is-jackson-optional-nullable
or the settinguseReflectionEqualsHashCode
should be removed since they might be irrelevant for this model.Since the difference for RestClient with
useSingleRequestParameter
set totrue
and set tostatic
is starting to diverge, I thought it made sense to also add an explicit test case for thestatic
case so the difference is properly illustrated (done with samples/client/petstore/java/restclient-useSingleRequestParameter-static).cc @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)
PR checklist
Commit all changed files.
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*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)