diegograssato / apigility-yaml-negotiation
Apigility Module providing YAML/YML/TXT content-negotiation features
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/diegograssato/apigility-yaml-negotiation
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: 2025-09-28 16:49:06 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