Code Monkey home page Code Monkey logo

generic-api's Introduction

Generic API

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads License

API Abstraction layer with mocks. Tools for creating structured SDKs or API implementations easy and following some simple guidelines.

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.

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

Functional Example

Can view a more complex example of functional API in the "sample" folder.

Copyright

This project is licensed under the MIT license.

generic-api's People

Contributors

diadal avatar rafrsr avatar yceruto avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

diadal

generic-api's Issues

EventDispatcher not found

Getting this error using the SampleAPI.php

Fatal error: Class 'Symfony\Component\EventDispatcher\EventDispatcher' not found in /path..i/vendor/rafrsr/generic-api/src/GenericApi.php on line 61

So I added "symfony/event-dispatcher" : "~2.8" in composer.json

After adding that, I'm getting the following error:

Fatal error: Call to a member function dispatch() on null in /path../vendor/rafrsr/generic-api/src/GenericApi.php on line 139

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.