<commit_before># JAD

JSON Api :heart: Doctrine ORM

[![Build Status](https://travis-ci.org/oligus/jad.svg?branch=master)](https://travis-ci.org/oligus/jad)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Codecov.io](https://codecov.io/gh/oligus/jad/branch/master/graphs/badge.svg)](https://codecov.io/gh/oligus/jad)

JAD is a library created for rapid development of [JSON API](http://jsonapi.org) backend REST implementation. You can
run JAD as a standalone server with php -S (see [demo](demo/README.md)), or you can use it as a middleware in your framework.

It turns doctrine entities ([doctrine/doctrine2](https://github.com/doctrine/doctrine2)) to a JSON API resource, or 
collection of resources automagically.

## Requirements

You need to have Doctrine installed and preferably setup before you can use Jad.

## Install

`composer require oligus/jad`

## Quick start

1. Annotate your entities that you want to expose to JSON-API:

```php
/**
 * @ORM\Entity
 * @ORM\Table(name="albums")
 * @Jad\Map\Annotations\Header(type="albums")<commit_msg>Add CodeTriage badge to oligus/jad<commit_after># JAD

JSON Api :heart: Doctrine ORM

[![Build Status](https://travis-ci.org/oligus/jad.svg?branch=master)](https://travis-ci.org/oligus/jad)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Codecov.io](https://codecov.io/gh/oligus/jad/branch/master/graphs/badge.svg)](https://codecov.io/gh/oligus/jad)
[![Open Source Helpers](https://www.codetriage.com/oligus/jad/badges/users.svg)](https://www.codetriage.com/oligus/jad)

JAD is a library created for rapid development of [JSON API](http://jsonapi.org) backend REST implementation. You can
run JAD as a standalone server with php -S (see [demo](demo/README.md)), or you can use it as a middleware in your framework.

It turns doctrine entities ([doctrine/doctrine2](https://github.com/doctrine/doctrine2)) to a JSON API resource, or 
collection of resources automagically.

## Requirements

You need to have Doctrine installed and preferably setup before you can use Jad.

## Install

`composer require oligus/jad`

## Quick start

1. Annotate your entities that you want to expose to JSON-API:

```php
/**
 * @ORM\Entity
 * @ORM\Table(name="albums")
 * @Jad\Map\Annotations\Header(type="albums")
{'fraction_non_alphanumeric': 0.14778947368421053, 'fraction_numerical': 0.0025263157894736842, 'mean_word_length': 4.823529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5944969', 'n_tokens_mistral': 833, 'n_tokens_neox': 807, 'n_words': 208}