Skip to content

Commit

Permalink
feat(ux): show file upload when schema has "format: base64"
Browse files Browse the repository at this point in the history
According to
#7325 (comment)
the uploaded file should be converted to base64 automatically.
  • Loading branch information
neiser committed Jun 16, 2021
1 parent ffad1fa commit 25aeafb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/plugins/oas3/components/request-body.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ const RequestBody = ({

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

if(
contentType === "application/octet-stream"
|| contentType.indexOf("image/") === 0
|| contentType.indexOf("audio/") === 0
|| contentType.indexOf("video/") === 0
|| isBinaryFormat
|| isBase64Format
) {
const Input = getComponent("Input")

Expand Down

0 comments on commit 25aeafb

Please sign in to comment.