feat: raw file body uploads (#3827)

raw file body uploads
This commit is contained in:
lohit
2025-01-17 13:08:27 +05:30
committed by GitHub
parent 3c8cb702f5
commit ecf883ba0d
26 changed files with 676 additions and 63 deletions

View File

@@ -74,9 +74,21 @@ const multipartFormSchema = Yup.object({
.noUnknown(true)
.strict();
const binaryFileSchema = Yup.object({
uid: uidSchema,
type: Yup.string().oneOf(['binaryFile']).required('type is required'),
name: Yup.string().nullable(),
value: Yup.array().of(Yup.string().nullable()).nullable(),
contentType: Yup.string().nullable(),
enabled: Yup.boolean()
})
.noUnknown(true)
.strict();
const requestBodySchema = Yup.object({
mode: Yup.string()
.oneOf(['none', 'json', 'text', 'xml', 'formUrlEncoded', 'multipartForm', 'graphql', 'sparql'])
.oneOf(['none', 'json', 'text', 'xml', 'formUrlEncoded', 'multipartForm', 'graphql', 'sparql', 'binaryFile'])
.required('mode is required'),
json: Yup.string().nullable(),
text: Yup.string().nullable(),
@@ -84,7 +96,8 @@ const requestBodySchema = Yup.object({
sparql: Yup.string().nullable(),
formUrlEncoded: Yup.array().of(keyValueSchema).nullable(),
multipartForm: Yup.array().of(multipartFormSchema).nullable(),
graphql: graphqlBodySchema.nullable()
graphql: graphqlBodySchema.nullable(),
binaryFile: Yup.array().of(binaryFileSchema).nullable()
})
.noUnknown(true)
.strict();