2017 © Pedro Peláez
 

library generic-api

API Abstraction layer with mocks

image

rafrsr/generic-api

API Abstraction layer with mocks

  • Thursday, May 24, 2018
  • by rafrsr
  • Repository
  • 1 Watchers
  • 3 Stars
  • 369 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 26 % Grown

The README.md

Generic API

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads License, (*1)

API Abstraction layer with mocks. Tools for creating structured SDKs or API implementations easy and following some simple guidelines., (*2)

Most APIs provide a SDK or API implementation library in parallel. But this not always true, or simply not made in our required language (php). For this cases is necessary implements the API from scratch. GenericApi is solution to keep things organized and follow a similar pattern for all libraries., (*3)

Features

  • Guzzle: Use guzzle with psr7 for requests, responses, and streams.
  • Mocks: Emulate request and response for test environments
  • Validation: Symfony validations to validate a request before send any data to remote API
  • Connection Abstraction: Only create the request, the connection is done automatically with guzzle, no more complicated curl connections.
  • Xml and Json Parser: Can use XML and JSON parser to convert API response to objects using JMS serializer
  • Scaffolding: Test API connection and any method using generic classes

Installation

  1. Install composer
  2. Execute: composer require rafrsr/generic-api

Documentation

Full documentation are available on the wiki page, (*4)

Functional Example

Can view a more complex example of functional API in the "sample" folder., (*5)

This project is licensed under the MIT license., (*6)

The Versions