swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

response body is no content, but if in real browser return json/string

Open toshim45 opened this issue 12 years ago • 4 comments

please help, if i open my apps from real browser will return this screen shot 2014-08-16 at 5 59 10 am but if I open it from "try it out" return this screen shot 2014-08-16 at 5 58 53 am I only change index.html

/* url: "http://petstore.swagger.wordnik.com/api/api-docs", */ 
url: "http://localhost:8080/pena-im/api-docs",

Am I missing some configuration ? by the way I'm just using dist folder, not building from source

Thanks in advance

toshim45 avatar Aug 15 '14 23:08 toshim45

Are you opening the swagger-ui from the filesystem? This is most likely a cors issue:

https://github.com/wordnik/swagger-core/wiki/CORS

fehguy avatar Aug 16 '14 01:08 fehguy

yes you're right @fehguy thanks a lot. issue solved. pls close this :)

toshim45 avatar Aug 16 '14 03:08 toshim45

Great

fehguy avatar Aug 16 '14 04:08 fehguy

If you are using .NET Core. Using this in startup.cs file

services .AddMvc() .AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);

bijayy33 avatar Oct 21 '17 07:10 bijayy33