-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix: #10618 Using incorrect @Multipart instead of @FormParam in microprofile java client #20690
base: master
Are you sure you want to change the base?
Conversation
…ram in microprofile java client [BUG][JAVA] Using incorrect @multipart instead of @FormParam when generated Microprofile java client OpenAPITools#10618 OpenAPITools#10618
thanks for the PR please update the samples to fix https://github.com/OpenAPITools/openapi-generator/actions/runs/13416373732/job/37671155659?pr=20690 |
oh I didn't commit and push the samles after generation. |
https://github.com/OpenAPITools/openapi-generator/actions/runs/13493811133/job/37840378475?pr=20690 please have a look at the test failure when you've time |
I got rid of the compilation error, but now I get this error:
I have no clue what the cause of this could be. After switching to
the java samples seem to build again. |
what if the required parameter is nullable (nullable: true) ? |
As far as I understand the spec and docs there is no "required" attribute for the microprofile/Jakarta REST @FormParam annotation. So I decided to combine required with bean-validation
instead of using the proprietary required attribute of CXF
IMHO you have to use BeanValidation additionally to Microprofile to get null checks. |
Fix #10618
[BUG][JAVA] Using incorrect @multipart instead of @FormParam when generated Microprofile java client
#10618
To fix #10618 I changed two template files of the Java client codegenerator for mircoprofile:
The non-standard annotations "@multipart" are replaced by the microprofile annotations "@FormParam".
the corresponding import "import org.apache.cxf.jaxrs.ext.multipart.*;" is deleted.
To be able to use required params the new version of the template uses "@NotNull" instead of "@multipart(value = "password", required = "true")", if "true" is set and the OpenAPI contract defines a field as required.
becomes
and
becomes
if "useBeanValidation" is set ton true
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)@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)