Giter VIP home page Giter VIP logo

jade's Introduction

Jade(Json Api Doctrine Exposer)

What is it?

Jade is a library created in an effort to create a simple way to create Json API server using doctrine entities. It supports all the CRUD functionality like filtering, sorting and including relationships. You just define the entities then using the configuration expose different routes.

It is done in a way to be easy to customize any part you need.

Another library?

Before starting developing this library we went through other available libraries even thinking about contributing to them. But the issue was that customizing those libraries to our needs was complicated and sometimes needed too much effort to even set it up. In case of Jade in 5 minutes you can have a fully functional API running.

Getting started

You can find a quick start example in docs/example.md

First install the library:

composer require trivago/jade

Next add the bundle to the kernel:

<?php

public function registerBundles()
{
        $bundles = [
            ...
            new Trivago\Jade\Application\Framework\JadeBundle\TrivagoJadeBundle(),
            ...
        ];
}

And then add the routing

json_api_routes:
    prefix: /api
    resource: .
    type: json_api

And then you have to setup the configuration.

Configuration

Read it here

Example configuration

Read it here

Entities

Read it here

Loading the routes

Read it here

Filtering

Read it here

Sorting

Read it here

Including

Read it here

Listeners

Read it here

Example calls

Read it here

Security concerns

Read it here

Tests

Read it here

Missing features

  • Allow choosing which fields to be included.
  • Validate the request for extra keys that are not valid.
  • Create the relationship urls.
  • Contain for a path that is string works fine. Find a new filter type name for path being an array that contains value.
  • [IMPROVED] Use ResourceMapper to avoid filtering or sorting on columns that are not rendered [security]

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.