From a66771bbd083f07ec5c7cbc0fb77436b6f36d79f Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:20:28 +0530 Subject: [PATCH] feat: add autocomplete for `multipart/formdata` individual content types (#4565) --- .../src/components/http/BodyParameters.vue | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/packages/hoppscotch-common/src/components/http/BodyParameters.vue b/packages/hoppscotch-common/src/components/http/BodyParameters.vue index 76ed35277..6fa832aab 100644 --- a/packages/hoppscotch-common/src/components/http/BodyParameters.vue +++ b/packages/hoppscotch-common/src/components/http/BodyParameters.vue @@ -121,6 +121,7 @@ entry.contentType ? entry.contentType : `Auto (Content Type)` " :auto-complete-env="true" + :auto-complete-source="autoCompleteContenTypes" :envs="envs" @change=" updateBodyParam(index, { @@ -255,6 +256,63 @@ const deletionToast = ref<{ goAway: (delay: number) => void } | null>(null) const bodyParams = pluckRef(body, "body") +const autoCompleteContenTypes = [ + "application/atom+xml", + "application/ecmascript", + "application/json", + "application/vnd.api+json", + "application/javascript", + "application/octet-stream", + "application/ogg", + "application/pdf", + "application/postscript", + "application/rdf+xml", + "application/rss+xml", + "application/soap+xml", + "application/font-woff", + "application/x-yaml", + "application/xhtml+xml", + "application/xml", + "application/xml-dtd", + "application/xop+xml", + "application/zip", + "application/gzip", + "application/graphql", + "application/x-www-form-urlencoded", + "audio/basic", + "audio/L24", + "audio/mp4", + "audio/mpeg", + "audio/ogg", + "audio/vorbis", + "audio/vnd.rn-realaudio", + "audio/vnd.wave", + "audio/webm", + "image/gif", + "image/jpeg", + "image/pjpeg", + "image/png", + "image/svg+xml", + "image/tiff", + "message/http", + "message/imdn+xml", + "message/partial", + "message/rfc822", + "multipart/mixed", + "multipart/alternative", + "multipart/related", + "multipart/form-data", + "multipart/signed", + "multipart/encrypted", + "text/cmd", + "text/css", + "text/csv", + "text/html", + "text/plain", + "text/vcard", + "text/xml", +] + // The UI representation of the parameters list (has the empty end param) const workingParams = ref([ {