Skip to content

Commit 69d93fa

Browse files
committed
feat(ux): show file upload when schema has "format: base64"
According to #7325 (comment) the uploaded file should be converted to base64 automatically.
1 parent 49c3f3b commit 69d93fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/core/plugins/oas3/components/request-body.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ const RequestBody = ({
108108

109109
const isObjectContent = mediaTypeValue.getIn(["schema", "type"]) === "object"
110110
const isBinaryFormat = mediaTypeValue.getIn(["schema", "format"]) === "binary"
111+
const isBase64Format = mediaTypeValue.getIn(["schema", "format"]) === "base64"
111112

112113
if(
113114
contentType === "application/octet-stream"
114115
|| contentType.indexOf("image/") === 0
115116
|| contentType.indexOf("audio/") === 0
116117
|| contentType.indexOf("video/") === 0
117118
|| isBinaryFormat
119+
|| isBase64Format
118120
) {
119121
const Input = getComponent("Input")
120122

0 commit comments

Comments
 (0)