2017 © Pedro Peláez
 

library apigility-yaml-negotiation

Apigility Module providing YAML/YML/TXT content-negotiation features

image

diegograssato/apigility-yaml-negotiation

Apigility Module providing YAML/YML/TXT content-negotiation features

  • Sunday, March 12, 2017
  • by diego.grassato
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

apigility-yaml-negotiation

YamlNegotiation module for Apigility., (*1)

Response type is based on Accept header :, (*2)

  • request that specifies text/yaml (or text/yml) get the content in YAML
  • application/hal+json (or application/*+json) request get the content in HalJson as usual.

Installation

Install composer in your project, (*3)

curl -s http://getcomposer.org/installer | php

Add dependency in composer.json., (*4)

composer require diegograssato/apigility-yaml-negotiation

Usage

  • Add ZF\ContentNegotiation\YAML to application.config.php:
return [
    'modules' => [
        ...
        'ZF\\ContentNegotiation\\YAML',
        ....
    ]
]    
  • Go to admin, select your API and change Content Negotiation Selector to HalJsonYAML
  • Add text/yaml to Accept whitelist and Content-Type whitelist. Add other headers if needed.
  • Save configuration

The Versions