All Projects → flexirest → Flexirest

flexirest / Flexirest

Licence: other
Flexirest - The really flexible REST API client for Ruby

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Flexirest

Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (+1.6%)
Mutual labels:  api, rest, json, rails
Pager Api
Easy API pagination for Rails
Stars: ✭ 86 (-54.26%)
Mutual labels:  api, json, rails, gem
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-51.06%)
Mutual labels:  api, rest, json
Behat Api Extension
API extension for Behat, used to ease testing of JSON-based APIs
Stars: ✭ 92 (-51.06%)
Mutual labels:  api, rest, json
Api Diff
A command line tool for diffing json rest APIs
Stars: ✭ 164 (-12.77%)
Mutual labels:  api, rest, json
Flask Restx
Fork of Flask-RESTPlus: Fully featured framework for fast, easy and documented API development with Flask
Stars: ✭ 1,050 (+458.51%)
Mutual labels:  api, rest, json
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-71.81%)
Mutual labels:  api, rest, json
Flickr Sdk
Almost certainly the best Flickr API client in the world for node and the browser
Stars: ✭ 104 (-44.68%)
Mutual labels:  api, rest, json
Apicache
Simple API-caching middleware for Express/Node.
Stars: ✭ 957 (+409.04%)
Mutual labels:  api, rest, json
Sabisu Rails
Simple and powerful engine for exploring your Rails api application
Stars: ✭ 129 (-31.38%)
Mutual labels:  api, json, rails
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-42.55%)
Mutual labels:  api, rest, json
Aping
angular module to get and display data by adding html-attributes
Stars: ✭ 135 (-28.19%)
Mutual labels:  api, rest, json
Jsonapi parameters
Rails-way to consume JSON:API input
Stars: ✭ 50 (-73.4%)
Mutual labels:  api, json, rails
Generator Http Fake Backend
Yeoman generator for building a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 49 (-73.94%)
Mutual labels:  api, rest, json
Dito
Dito.js is a declarative and modern web framework with a focus on API driven development, based on Objection.js, Koa.js and Vue.js – Released in 2018 under the MIT license, with support by Lineto.com
Stars: ✭ 44 (-76.6%)
Mutual labels:  api, rest, json
Graphql devise
GraphQL interface on top devise_token_auth
Stars: ✭ 100 (-46.81%)
Mutual labels:  api, rails, gem
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-22.34%)
Mutual labels:  api, rest, json
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+20957.45%)
Mutual labels:  api, rest, json
Versionist
A plugin for versioning Rails based RESTful APIs.
Stars: ✭ 950 (+405.32%)
Mutual labels:  api, rest, rails
Invoice As A Service
💰 Simple invoicing service (REST API): from JSON to PDF
Stars: ✭ 106 (-43.62%)
Mutual labels:  api, rest, json

Flexirest

Access your REST APIs in a flexible way.

Write your API classes in an ActiveRecord-style; like ActiveResource but Flexirest works where the resource naming doesn't follow Rails conventions, it has built-in caching and is much more flexible.

Build Status Coverage Status Code Climate Gem Version Average time to resolve an issue Percentage of issues still open

Background

If you are a previous user of ActiveRestClient, there's some more information on why I created this fork and how to upgrade - but long story short, I wrote most of the code as a previous gem for a client, they agreed to open-source it, then it was abandoned and I relaunched it and now support it myself (and the owners of ActiveRestClient have acknowledged their gem is deprecated in favour of Flexirest).

Quickstart

Assuming you're using Bundler, to use Flexirest add this line to your application's Gemfile:

gem 'flexirest'

And then execute:

$ bundle

To use it, let's create a new model class:

# app/models/person.rb
class Person < Flexirest::Base
  base_url "https://www.example.com/api/v1"

  get :all, "/people"
  get :find, "/people/:id"
  put :save, "/people/:id"
  post :create, "/people"
  delete :remove, "/people/:id"
end

You can then use your new class like this:

# Create a new person
@person = Person.create(
  first_name:"John"
  last_name:"Smith"
)

# Find a person (not needed after creating)
id = @person.id
@person = Person.find(id)

# Update a person
@person.last_name = "Jones"
@person.save

# Get all people
@people = Person.all
@people.each do |person|
  puts "Hi " + person.first_name
end

Reading further

I've written a TON of documentation on how to use Flexirest and a LITTLE bit on how it works internally. For more information see the following pages:

Licence

Code originally copyright© 2013 Which? Ltd, released with an MIT License and now this fork is released under the same licence by Andy Jeffries.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

If you want to generate a reproducible bug report, here are some steps to follow in your bug report:

  1. Clone the Flexirest repo (git clone https://github.com/flexirest/flexirest.git)
  2. Change to the flexirest folder (cd flexirest)
  3. Install any dependencies (bundle install)
  4. Run an interactive console (rake c)
  5. Paste the following:
class MyObject < Flexirest::Base
  base_url "https://requestb.in"
  post :create, "/{CREATE_A_PASTEBIN_ID}"
end

my_object = MyObject.new(params: "something")
my_object.create
# => something is output to the terminal

Working on the codebase

The general steps are the same as for almost all codebases on GitHub:

  1. Fork it and clone your fork
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request on GitHub.com

We have a guide written about Flexirest Internals if you want to know how it all hangs together. We also have lots of RSpec specifications, tested with Travis CI.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].