diegograssato / apigility-yaml-negotiation
Apigility Module providing YAML/YML/TXT content-negotiation features
v1.0
2017-03-12 02:18 UTC
Requires
- php: ^5.6 || ^7.0
- zendframework/zend-component-installer: ^1.0 || ^0.5 || ^1.0.0-dev@dev
- zendframework/zend-serializer: ^2.7.7 || ^3.0.1
- zendframework/zend-stdlib: ^2.7.7 || ^3.0.1
- zfcampus/zf-apigility: ^1.3
- zfcampus/zf-content-negotiation: ^1.2
This package is auto-updated.
Last update: 2024-10-28 14:46:42 UTC
README
YamlNegotiation module for Apigility.
Response type is based on Accept header :
- 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
curl -s http://getcomposer.org/installer | php
Add dependency in composer.json.
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