Replies: 1 comment
-
Anyone? :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been trying to create an API which allows the user to create a Product instance with information they supply and upload an image for that product in a single API call.
I have been able to achieve file uploads for existing Product instances with APIs such as the following:
The above works, but
@requestBody.file()
seems to prevent adding any normal @RequestBody params as would be done in normal 'create product' API calls.The only option I've been able to get working so far is the following - but I'm concerned that it's hacky and seems like a bad solution:
The above works, but damn it seems like a hacky solution.
Swagger gives me an error - it seems the @param.query.object getModelSchemaRef(Product) doesn't work:

Any advice on how to proceed? Ideally I want to pass in a file and a normal JSON payload, but I suspect it's not that straight forward as that would be mixing mime types.
Beta Was this translation helpful? Give feedback.
All reactions