gimler/guzzle-description-loader

Load guzzle service description from various file formats

Maintainers

👁 gimler

Package info

github.com/gimler/guzzle-description-loader

pkg:composer/gimler/guzzle-description-loader

Statistics

Installs: 322 157

Dependents: 11

Suggesters: 2

Stars: 16

Open Issues: 8

v0.0.4 2016-01-27 06:35 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT d1384a65ffb1a10a7e9e17c427e77b281ae38498

  • Gordon Franke <info.woop@nevalon.de>
  • Community

This package is not auto-updated.

Last update: 2026-06-07 02:16:41 UTC


README

👁 Build Status
👁 Dependency Status

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"
 ]
}