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

Honor 'sentAs' name when property type is 'array' #141

Closed dwoldo closed 7 years ago

dwoldo commented 7 years ago

It appears that when using the following model, "sentAs" is not used when the type is set to 'array':

"models" : {
        "Contact" : {
            "type":  "object",
            "properties" : {
                "id" : {
                    "type": "string",
                    "location" : "json",
                    "sentAs" : "_id"
                }
            },
            "additionalProperties" : "false"
        },
        "ContactsCollection" : {
            "type":  "object",
            "properties" : {
                "total" : {
                    "type": "integer",
                    "location" : "json"
                },
                "contacts" : {
                    "location" : "json",
                    "type" : "array",
                    "sentAs" : "data",
                    "items" : {
                        "$ref" : "Contact"
                    }
                }
            }
Konafets commented 7 years ago

Can you add a test for this case?

Konafets commented 7 years ago

@dwoldo Can you check if this is related to #152.

dwoldo commented 7 years ago

@Konafets Yes. We changed the same line but @my2ter wrote tests for it.

Konafets commented 7 years ago

Fixed by #152