guzzle / guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
MIT License
253 stars 78 forks source link

Feature Request: Ability to Specify "process: false" at Operation Level #172

Open GuyPaddock opened 5 years ago

GuyPaddock commented 5 years ago

We are working with a service that is mostly JSON but that has some resources that return binary data (images). Trying to accommodate this with the current version of Guzzle Services is inconvenient because the option as to whether or not a response should be parsed/processed is specified in the service client config instead of in the operation config.

My current workaround is that all of our requests go through a services tier/request facade. That facade uses one version of the Guzzle services client for requests that need JSON, and a different version for binary requests. But that also means we have to remember not to invoke the wrong service commands on the wrong client, OR we have to keep the configurations for the two types of clients separate.

Instead, it would be great if I could provide a config like this:

operations:
  getFile:
    httpMethod: 'GET'
    process: false
    uri: 'serve/{file_id}'
    parameters:
      file_id:
        location: 'uri'
        description: 'The unique identifier of the file being requested.'
        type: 'integer'
        required: true
        minimum: 1

The key is process: false. This is not currently supported.