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
default ResponseEntity<Void> uploadFile(MultipartFile body) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
openapi-generator version
I have found related issues, but every version I have tried contains this bug:
6.0.0-beta
5.4.0
5.1.0 <-- found similar tickets that said it should not exists here (Seems like the GET version of this issue has been fixed)
Bug Report Checklist
Description
When using the delegate pattern, delegates are generated with incorrect types for requests which accept file parameters.
You can see the following below, the delegate is generated accepting a MultipartFile while the controller passes a Resource.
Controller Code:
Delegate Code:
openapi-generator version
I have found related issues, but every version I have tried contains this bug:
6.0.0-beta
5.4.0
5.1.0 <-- found similar tickets that said it should not exists here (Seems like the GET version of this issue has been fixed)
OpenAPI declaration file content or url
You can find the issue reproduced in this project here spring resource bug
Generation Details
I am simply using
mvn clean compile
here is the pom.xmlSteps to reproduce
mvn clean compile
due to type mismatches between delegates and controllersRelated issues/PRs
#9462
#3905 <-- this issue states it was fixed in v4.0.0-beta3 but maybe it was reintroduced or the beta never became a stable release?
Suggest a fix
I have found two work around both of which do not conform to OAS3, but I have found to at least get past build errors:
Solution 1 Custom Type:
Solution 2 Codegen Type:
Use this in your spec
This works because this line in
SpringCodegen.java
typeMapping.put("file", "org.springframework.core.io.Resource");
I suspect the solution would be to fix the code generating delegate interfaces.
The text was updated successfully, but these errors were encountered: