Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to load swagger.json if Content-Type is not application/json #58

Open
polymeris opened this issue Oct 4, 2018 · 2 comments
Open

Comments

@polymeris
Copy link
Contributor

My server is returning swagger.json with a Content-Type: text/plain header, which seems to confuse martian. It fails to register any endpoints, silently.

Not sure if this is something you want to fix or expected behavior, but I would suggest adding a warning, if possible.

@polymeris
Copy link
Contributor Author

Btw, I am not sure if :as :json here does anything. I think that's a clj-http option.
https://github.com/oliyh/martian/blob/master/cljs-http/src/martian/cljs_http.cljs#L29

@oliyh
Copy link
Owner

oliyh commented Oct 13, 2018

Hi,

Thanks for reporting this. Yes, you're right - the :as :json doesn't seem to be an option in cljs-http, instead it's just looking for the application/json content type.

I think a warning could be ok but I would prefer it to be something that could be checked. I would like to have a spec for the Martian instance which could allow validation at creation time and then the developer could decide what to do.

I'll have a think about this, it's probably unlikely to happen soon though. PRs welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants