-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Please verify that this feature request has NOT been suggested before.
- I checked and didn't find a similar feature request
Problem statement
I have been playing with a Qt based implementation generated from the openapi schema with the openapi-generator.
I tried to upload image to a part but I failed to do so.
The image is defined the following way in the schema:
image:
type: string
format: uri
nullable: true
My first idea was posting base64 image but it was rejected by the server.
Then I moved onto studying the python API and it turned out that images uploaded to objects derived from ImageMixin-s need to be posted separately as a file under the 'image' key, not packaged to the JSON post data.
I tailored my Qt client code to post the raw image as a file and it works just fine.
Suggested solution
I am posting this as a "placeholder", to aid others coming through similar in the future.
To fix I need to do research on openapi schema capabilities to see if it is possible to describe expected files in the post data.
If it is capable to do it I need to understand if the generated schema could be modified for the ImageMixin based objects.
Describe alternatives you've considered
In the case if the file upload cannot be described in the schema, removing the image fields from ImageMixin-s could be a good idea because as I see it there is no way to post image data this way (i.e. the field is useless in this definition format.)
Examples of other systems
Do you want to develop this?
- I want to develop this.