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 put other models definition for list items ? #159

Closed marcoooo closed 6 years ago

marcoooo commented 6 years ago

Hi, thanks for your module :-)

I want to know if it's possible to assign "models" inside results type array in service definition, for example:

"CardReference": {
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "The url leading to the full Card object."
    },
    "reference": {
      "type": "string",
      "description": "ID of the card."
    },
    "points_balance": {
      "type": "string",
      "description": "The balance of unused points in the card."
    }
  }
},
"CardList": {
  "type": "object",
  "extends": "RootList",
  "properties": {
    "results": {
      "type": "array",
      "items": {
        "type": "CardReference"
      }
    }
  }
marcoooo commented 6 years ago

Well I answer myself, yes :-)