Description
Question
Hi !
I have tried to upload an image that can be either a png or a jpeg, but It didn't work for me.
Here's a demo of a requestBody that I used to achieve the following according to OpenAPI encoding specification:
requestBody:
description: The avatar file
required: true
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
encoding:
file:
contentType: image/png, image/jpeg
Unfortunatly, I'm getting this error:
Validation warning: Inconsistency encountered when parsing ``: 'image/png, image/jpeg' could not be parsed as a Content Type. Content Types should have the format '<type>/<subtype>'. [context: codingPath=.paths['/profiles/{id}/avatar'].post.requestBody.content['multipart/form-data'].encoding.file.contentType, contextString=, subjectName=]warning: Validation warning: Inconsistency encountered when parsing ``: 'image/png, image/jpeg' could not be parsed as a Content Type. Content Types should have the format '<type>/<subtype>'. [context: codingPath=.paths['/profiles/{id}/avatar'].post.requestBody.content['multipart/form-data'].encoding.file.contentType, contextString=, subjectName=]Error: Invalid content type string: 'image/png, image/jpeg', must have 2 components separated by a slash.
Can you tell me what I did wrong ?
Thanks !