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

Is there a way to reuse operation parameters? #140

Closed Napas closed 2 years ago

Napas commented 7 years ago
baseUri: 'http://localhost`
operations:
    createUser:
        uri: /user
        httpMethod: POST
        responseModel: userModel
        parameters:
            username:
                type: string
                required: true
                location: json
            email:
                type: string
                required: true
                location: json
    createUsers:
        uri: /users
        httpMethod: POST
        parameters:
            payload:
                type: array
                location: json

Is there a way to tell that payload in createUsers operation has an array with same parameters as createUser operation?

And can operation send array of objects without assigning it to the payload (or any other) key(s)?

Konafets commented 7 years ago

Do your use https://github.com/gimler/guzzle-description-loader for processing this yaml config?

However, it all comes down to a plain PHP array, because this is what the Description() expects. I would try to stick to the YAML rules of referencing some parts and let the YAML parser do the rest.

GrahamCampbell commented 2 years ago

Closing since stale - I'm doing a cleanup across the whole organization, to enable us to focus on the tickets that are still live and have interest. Please feel free to open a new issue if this still is important to you. :)