free2er/json-negotiator-bundle

JSON Negotiator Bundle

1.0.1 2019-11-28 19:14 UTC

This package is auto-updated.

Last update: 2024-11-29 05:33:34 UTC


README

JSON Negotiator Bundle

Installation

This component can be installed with the Composer dependency manager.

  1. Install Composer

  2. Install the component as a dependency of your project

     composer require free2er/json-negotiator-bundle
    
  3. Enable the bundle

<?php

// config/bundles.php
return [
    // ...
    Free2er\Json\JsonNegotiatorBundle::class => ['all' => true],
    // ...
];
  1. Configure negotiation options
# config/packages/json_negotiator.yaml
json_negotiator:
    content_types:
        - json
        - jsonld
    methods:
        - POST
        - PATCH
        - PUT 
  1. Done!