The HTTP abstraction library for Clojure/script, supporting OpenAPI, Swagger, Schema, re-frame and more
MIT License
Bot releases are hidden (Show)
Published by oliyh about 7 years ago
This release improves the martian story in Clojurescript, with improvements to the cljs-http
library and a new library called martian-re-frame
which provides bindings to use martian idiomatically with re-frame.
The API for martian-test
was also improved to allow easier stubbing of responses.
The following issues were addressed:
cljs-http
Leave interceptors are run inside a go block, so they no longer need to be aware of core.async #41re-frame
bootstrap signature now allows you to pass in your own interceptors and options #36re-frame
Added a subscription for the martian instance #37Published by oliyh about 7 years ago
This release further improves martian's idiomatic Clojure credentials by inferring the mappings between the field names used by the API and the idiomatic Clojure key - for example, if the API requires a key FooBar
you can provide :foo-bar
to martian. This is covered in more detail in #34.
The following issues were addressed:
Published by oliyh almost 8 years ago
The major feature introduced in this release is the ability to provide interceptors for individual handlers. This allows you to handle special cases much more elegantly.
They can be defined either as part of the bootstrap
data:
(martian/bootstrap "https://api.org"
[{:route-name :load-pet
:path-parts ["/pets/" :id]
:method :get
:path-schema {:id s/Int}
:interceptors [{:id ::override-load-pet-method
:enter #(assoc-in % [:request :method] :xget)}]}])
Or by using the helper to modify an existing martian record:
(-> (martian/bootstrap-swagger "https://api.org" swagger-definition)
(martian/update-handler :load-pet assoc :interceptors [{:id ::override-load-pet-method
:enter #(assoc-in % [:request :method] :xget)}]))
Other changes include:
:martian.core/body
, see #30 (thanks @markdingram)Published by oliyh almost 8 years ago
Fixed a bug where consumes
parameter was taken from the produces
key resulting in incorrect serialisation on bodies where consumes was different to produces.
https://github.com/oliyh/martian/commit/d8194084adf23cc4d2e323b4e34b85beb04335ea
Published by oliyh almost 8 years ago
Please view the readme for details.
Published by oliyh almost 8 years ago
This release focussed mainly on improving the martian API for more practical use and adding the ability to perform generative testing.
bootstrap
function which accepts data structures describing APIs in a Swagger-like way without requiring Swagger at all