Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegograssato/apigility-yaml-negotiation
Apigility Module providing YAML/YML/TXT content-negotiation features
https://github.com/diegograssato/apigility-yaml-negotiation
Last synced: 23 days ago
JSON representation
Apigility Module providing YAML/YML/TXT content-negotiation features
- Host: GitHub
- URL: https://github.com/diegograssato/apigility-yaml-negotiation
- Owner: diegograssato
- License: mit
- Created: 2017-03-12T01:56:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-12T02:18:55.000Z (over 7 years ago)
- Last Synced: 2024-10-10T11:25:25.252Z (about 1 month ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
apigility-yaml-negotiation
=========================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 projectcurl -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:```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