cancel
Showing results for 
Search instead for 
Did you mean: 

swagger multipart TypeError: Failed to fetch

Highlighted
New Contributor

swagger multipart TypeError: Failed to fetch

Hello,

I have a swagger installed on IIS Windows Server 2016. 

It is linked with ServiceNow. I have several paths and methods working fine except this single one.

It is using a multipart request body.

 

I get an error "TypeError: Failed to fetch"

I have tried the code on the swaggerHub and it worked;

I suspect something is missing on my IIS or on my swagger UI config. Do you have any clue?

 

post:
parameters:
- name: "Content-Type"
in: "header"
required: true
schema :
type : "string"
default: "multipart/form-data"
requestBody:
content:
multipart/form-data:
schema:
type: "object"
properties:
table_name:
type: 'string'
format: 'string'
example : "rm_feature"
table_sys_id:
type: 'string'
format: 'string'
example : "6e1ef1f41bd9bf4421d44111cd4bcb2f"
data:
type: "string"
format: "binary"

 

3 REPLIES 3
Community Manager

Re: swagger multipart TypeError: Failed to fetch

Hi @younseb,

 

I've heard that this error appears in SwaggerHub also. Switching to the Proxy mode helps there. Do you have anything similar in Swagger UI?

https://app.swaggerhub.com/help/ui/interactive-documentation#routing

---------
Tanya Gorbunova
SmartBear Community Manager

Join the September Hub-bub to show off, learn and win
New Contributor

Re: swagger multipart TypeError: Failed to fetch

Hello Tanya.

It is actually the opposite...

1. This code is working fine on swaggerHub

2. This isn't working on my server on SwaggerUI and SwaggerEditor.

 

Another thing, I have several paths & methods. All are working (GET, POST, PUT, DELETE with json).

Only this one with content-Type multipar/form-data doesn't work on my server.

 

I suspect it may has to do with some permissions (no file upload allowed).

If so I'm not sure which folder should be opened on SwaggerUI.

Moderator

Re: swagger multipart TypeError: Failed to fetch

Which version of Swagger UI do you use? At what point do you gett the error? Is that the full error you're seeing? Can you check the browser console for any additional details around that error?

New Here?
Join us and watch the welcome video:
Watch the New Interview
7Mistakes
Join our online event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win