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
The OpeAPI spec (3.0.2) declares an endpoint with a required parameter and a file upload in the request body. The assigned controller method is never invoked by swagger-inflector (2.0.0) as the expected call params aren't matched.
java.lang.IllegalArgumentException: argument type mismatch
To reproduce, set a breakpoint in TestController#uploadTest(), and it is never hit in the debugger.
The reason seems to be in io.swagger.oas.inflector.controllers.OpenAPIOperationController.java lines 354-356: the element at index 2 of the original args[3] should be set with the returned argument (the file object), but instead the whole half-populated args[] gets replaced with args2[] that assumes, that the returned file object is always at index 1, which is not correct when the path contains parameters.
The text was updated successfully, but these errors were encountered:
genealogy-cz
changed the title
File upload with a path parameter doesn't invoke a container method.
File upload with a path parameter doesn't invoke the controller method.
May 13, 2019
The OpeAPI spec (3.0.2) declares an endpoint with a required parameter and a file upload in the request body. The assigned controller method is never invoked by swagger-inflector (2.0.0) as the expected call params aren't matched.
The POST call is done with curl:
The error is:
To reproduce, set a breakpoint in
TestController#uploadTest()
, and it is never hit in the debugger.The reason seems to be in
io.swagger.oas.inflector.controllers.OpenAPIOperationController.java
lines 354-356: the element at index 2 of the originalargs[3]
should be set with the returnedargument
(the file object), but instead the whole half-populatedargs[]
gets replaced withargs2[]
that assumes, that the returned file object is always at index 1, which is not correct when the path contains parameters.The text was updated successfully, but these errors were encountered: