File tree 1 file changed +8
-2
lines changed
src/core/plugins/oas31/oas3-extensions
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ export const makeIsFileUploadIntended = (getSystem) => {
8
8
const isFileUploadIntended = ( schema , mediaType = null ) => {
9
9
const { fn } = getSystem ( )
10
10
11
+ /**
12
+ * Return `true` early if the media type indicates a file upload
13
+ * or if a combination of type: `string` and format: `binary/byte` is detected.
14
+ * This ensures support for empty Media Type Objects,
15
+ * as the schema check is performed later.
16
+ */
11
17
const isFileUploadIntendedOAS30 = fn . isFileUploadIntendedOAS30 (
12
18
schema ,
13
19
mediaType
@@ -31,8 +37,8 @@ export const makeIsFileUploadIntended = (getSystem) => {
31
37
: schema . contentEncoding
32
38
33
39
return (
34
- ( contentMediaType && typeof contentMediaType === "string ") ||
35
- ( contentEncoding && typeof contentEncoding === "string ")
40
+ ( typeof contentMediaType === "string" && contentMediaType !== " ") ||
41
+ ( typeof contentEncoding === "string" && contentEncoding !== " ")
36
42
)
37
43
}
38
44
You can’t perform that action at this time.
0 commit comments