brooklynDev / airborne

RSpec driven API testing framework
MIT License
1.13k stars 122 forks source link

Optional array of hashes #50

Open jqdurham opened 9 years ago

jqdurham commented 9 years ago

Given the following JSON. How could you validate JSON types for the owner's name. This is an example from your documentation, but the Lamborghini's owner has been removed.

{
    "cars":[
        {
            "make":"Tesla",
            "model":"Model S",
            "owners":[
                {
                    "name":"Bart Simpson"
                }
            ]
        },
        {
            "make":"Lamborghini",
            "model":"Aventador"
        }
    ]
}

The optional() method appears to only support optional hashes. How do we validate optional arrays of hashes?

sethpollack commented 9 years ago

Its not currently supported, but, I'll look into implementing it. Thanks for pointing it out!