Anyone used https://github.com/oliyh/martian? I just ran across it yesterday and it looks pretty awesome to me. I’ve increasingly wondered what the point is of wrapping APIs in libraries and these days tend to use HTTP clients more directly. I’d been sort of writing my own wrappers so I’d have a protocol I could easily mock for testing, but the most recent one I’ve written only has a single request method… I’ve just found myself drifting more and more towards simplicity. But then when it comes to logging and mocking, it’s nice to have named operations, and argument validation, and Martian seems like exactly the direction I was heading in. The author gave a talk to London Clojurians that I’m looking forward to watching when I have a minute: https://www.youtube.com/watch?v=smzc8XlvlSQ
No. Ill have to watch that.
If I understand correctly, it’s basically like the https://github.com/mcohen01/amazonica approach vs the https://github.com/cognitect-labs/aws-api approach.
(aws-api being more Martian style).
Nice. Just reading thru docs and it looks like a huge timesaver in addition to its other benefits.
I was on the other side of something like this: needed to provide a conforming API interface for a tool that would work with any generic API that implemented it. It can be pretty constraining on the producing side but the benefit of being able to point that third party client to it is quite nice, and because you have such a (hopefully) well-defined schema to implement there's a lot less bikeshedding at the design phase. Codegen over a schema like this on the consumer side would be equally nice in many cases though if there is an official Java wrapper I'd usually default to that.