arthurkirkosa / guzzle-description-loader
Load guzzle service description from various file formats
Installs: 270 285
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 16
pkg:composer/arthurkirkosa/guzzle-description-loader
Requires
- php: ^7.0|^8.0
- symfony/config: *
- symfony/yaml: *
This package is auto-updated.
Last update: 2025-10-21 07:54:16 UTC
README
Guzzle Service Description Loader
A stand-alone Service Description loader for Guzzle 5.x.
Installation
If you are using Composer, and you should, just run the following command:
composer require "gimler/guzzle-description-loader"
Supported File Formats
- Yaml
- Php
- Json
Usage
use Guzzle\Service\Loader\JsonLoader; use GuzzleHttp\Command\Guzzle\Description; use Symfony\Component\Config\FileLocator; $configDirectories = array(DESCRIPTION_PATH); $this->locator = new FileLocator($configDirectories); $this->jsonLoader = new JsonLoader($this->locator); $description = $this->jsonLoader->load($this->locator->locate('description.json')); $description = new Description($description);
Sample
{
"operations": {
"certificates.list": {
"httpMethod": "GET",
"uri": "certificates",
"description": "Lists and returns basic information about all of the management certificates associated with the specified subscription.",
"responseModel": "CertificateList"
}
},
"models": {
"CertificateList": {
"type": "array",
"name": "certificates",
"sentAs": "SubscriptionCertificate",
"location": "xml",
"items": {
"type": "object"
}
}
},
"imports": [
"description_import.json"
]
}