Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leedavis81/drest
Quickly and easily expose Doctrine entities as REST resource endpoints with the use of simple configuration with annotations, yaml, json or a PHP array.
https://github.com/leedavis81/drest
Last synced: about 1 month ago
JSON representation
Quickly and easily expose Doctrine entities as REST resource endpoints with the use of simple configuration with annotations, yaml, json or a PHP array.
- Host: GitHub
- URL: https://github.com/leedavis81/drest
- Owner: leedavis81
- License: mit
- Created: 2013-02-08T11:19:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T10:05:01.000Z (over 7 years ago)
- Last Synced: 2024-08-01T21:58:18.621Z (4 months ago)
- Language: PHP
- Homepage: http://leedavis81.github.io/drest
- Size: 1.79 MB
- Stars: 87
- Watchers: 8
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php - Drest - A library for exposing Doctrine entities as REST resource endpoints. (Table of Contents / API)
- awesome-rest - Drest - Library for exposing Doctrine entities as REST resource endpoints. (Servers / PHP)
- awesome-php-cn - Drest - 为揭露教条实体图书馆REST资源端点. (目录 / API)
- awesome-projects - Drest - A library for exposing Doctrine entities as REST resource endpoints. (PHP / API)
- awesome-php - Drest - A library for exposing Doctrine entities as REST resource endpoints. (Table of Contents / API)
README
Drest
=====### Dress up doctrine entities and expose them as REST resources
[![Build Status](https://travis-ci.org/leedavis81/drest.svg)](https://travis-ci.org/leedavis81/drest/settings)
[![Code Coverage](https://scrutinizer-ci.com/g/leedavis81/drest/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/leedavis81/drest/?branch=master)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/leedavis81/drest/badges/quality-score.png?s=54655af2afbd263417c9e80a4d6ee9664083b5c5)](https://scrutinizer-ci.com/g/leedavis81/drest/)
[![Latest Stable Version](https://poser.pugx.org/leedavis81/drest/v/stable.png)](https://packagist.org/packages/leedavis81/drest)
[![Total Downloads](https://poser.pugx.org/leedavis81/drest/downloads.png)](https://packagist.org/packages/leedavis81/drest)
[![Dependency Status](https://www.versioneye.com/user/projects/5194ec66296d610002000343/badge.png)](https://www.versioneye.com/user/projects/5194ec66296d610002000343)
[![HHVM Status](http://hhvm.h4cc.de/badge/leedavis81/drest.svg)](http://hhvm.h4cc.de/package/leedavis81/drest)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)This library allows you to quickly annotate your doctrine entities into restful resources. It comes shipped with it's own internal router, and can be used standalone or alongside your existing framework stack. Routes are mapped to either a default or customised service action that takes care of handling requests.
Setting up endpoints is as easy as adding in a simple annotation to an entity
```php
/* @Drest\Resource(
* routes={
* @Drest\Route(
* name="get_user",
* route_pattern="/user/:id",
* verbs={"GET"}
* )})
* @ORM\Table(name="user")
* @ORM\Entity
*/
class User
{
.......
}// hitting [GET] http://myapplication.com/user/123 may return:
{
"user": {
"name": "lee",
"email": "[email protected]"
... + other attributes set up to be exposed ...
}
}
```## Documentation
Check out how to use drest by [reading the documentation](http://leedavis81.github.io/drest/)
## Features
- Quickly annotate existing Doctrine entities to become a fully functional REST resource.
- Utilises the internal router for matching resource route patterns.
- Specify what data you want to expose from your entities (including relations), or let the client choose!
- Generate data objects using exposable data for your API users to consume.
- Comes shipped with both JSON and XML representations, or you can create your own.
- Allows media type detection from your client requests, getting you one step close to RMM level 3.
- Use it independently from your existing framework stack, or alongside it.
- Allows extension points so you can configure requests to your specific needs.