FaradayMiddleware::Avro
Faraday request middleware.
Installation
Add this line to your application's Gemfile:
gem 'faraday_middleware-avro'
And then execute:
$ bundle
Usage
connection = Faraday.new do |conn|
conn.request :avro, schemas_path: File.expand_path(File.dirname(__FILE__))
conn.adapter Faraday.default_adapter
end
offer = { name: "Minha oferta",
unit: "Kg",
seller_code: "123",
seller_categories: "Categoria 1",
catalogs: ["outono"]
}
connection.post("http://0.0.0.0:3000/endpoint", offer, 'Avro-Schema' => 'offer')
Todo
- Make it possible to pass the schema
Contributing
- Fork it ( https://github.com/[my-github-username]/faraday_middleware-avro/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request