oliyh/martian

Is it possible to use a file:// url for the openapi deifinition?

jave opened this issue · 2 comments

jave commented

I tried this, but it didn seem to work:
(let [m (martian-http/bootstrap-openapi "file:///api.yaml")] )

I wanted to use this api definition, but martian gives an exception
https://api.mangadex.org/docs/static/api.yaml

So i would like to bisect the api file locally.

oliyh commented

Hi,

I have made this possible in #175

It's now documented in the README:

Note that when calling bootstrap-openapi you can also provide a url to a local resource, e.g. (martian-http/bootstrap-openapi "public/openapi.json"). For ClojureScript the file can only be read at compile time, so a slightly different form is required using the martian.file/load-local-resource macro:

(martian/bootstrap-openapi "https://sandbox.example.com" (load-local-resource "openapi-test.json") martian-http/default-opts)
oliyh commented

Available now on Clojars in 0.1.23-SNAPSHOT, I'd be interested in your feedback