You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you provided a full/minimal spec to reproduce the issue?
Have you validated the input using an OpenAPI validator (example)?
[] Have you tested with the latest master to confirm the issue still exists? (Blocked by corporate firewall unfortunately)
Have you searched for related issues/PRs?
What's the actual output vs expected output?
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When defining an endpoint that consumes multipart/form-data that contains optional parameters, the generated XXXApi.java interface class does not produce a parameter wrapped in Optional whereas the accompanying XXXXApiDelegate.java does, thus where the Api calls the Delegate, the compiler rightly throws the error:
incompatible types: java.lang.String cannot be converted to java.util.Optional<java.lang.String>
This case with useOptional=true and delegatePattern=true generates this error. If one of this switches is set to false, the compilation is successful.
We are running into the same issue.
Does anyone have a better workaround?
Bug Report Checklist
Description
When defining an endpoint that consumes multipart/form-data that contains optional parameters, the generated XXXApi.java interface class does not produce a parameter wrapped in
Optional
whereas the accompanying XXXXApiDelegate.java does, thus where the Api calls the Delegate, the compiler rightly throws the error:Generated API
Generated API Delegate
openapi-generator version
5.1.1
swagger version
2.0
OpenAPI declaration file content or url
pom
Generation Details
Run:
Steps to reproduce
Run:
Related issues/PRs
Suggest a fix
Need to have the API define optional parameters as
Optional
The text was updated successfully, but these errors were encountered: