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

Doesn't work with yaml?

Open spacesuitdiver opened this issue 9 years ago • 7 comments

spacesuitdiver avatar Oct 15 '15 00:10 spacesuitdiver

I was wondering this same thing. Does the spec have to be in JSON? If so, can you add this note in the theme's documentation?

tomjoht avatar Jan 27 '16 14:01 tomjoht

This is not supported by swagger-ui. Please check: https://github.com/swagger-api/swagger-ui/issues/595

jensoleg avatar Feb 27 '16 16:02 jensoleg

Swagger UI does work with YAML currently, it's just not clearly documented. The "tricky" part is that you actually have to make sure your server is sending the YAML file with the content type set to "application/yaml". Once that's in place it works as expected.

jordanjennings avatar Mar 06 '16 02:03 jordanjennings

Confirmed. I tried to merge this theme with newest swagger-ui (2.1.4). YAML file load, but it looks like some CSS styles don't apply anymore (did they change HTML structure?).

KamilKopaczyk avatar Mar 10 '16 11:03 KamilKopaczyk

@KamilKopaczyk did you ever get this working? Do you have a fork I could take a look at?

mturner avatar Jun 04 '16 07:06 mturner

I changed the package.json file from:

"swagger-client": "git+https://github.com/jensoleg/swagger-js.git"

to:

"swagger-client": "git+https://github.com/swagger-api/swagger-js.git"

And ran:

npm update
gulp

After that, this project supports YAML ;-) But, some little things (like label colors) are broken...

gabrielrcouto avatar Jul 18 '16 17:07 gabrielrcouto

@gabrielrcouto I change the package.json file but after npm update causing me some error. It would be benefit for all if you could give the link to your repository so we can fork it

Vivek2s avatar Apr 13 '17 05:04 Vivek2s