I would like to have an endpoint that validates against multiple schemas. I've read the docs and some of Eve's code but it's not immediately clear to me that this is possible. Here's a simple example of what I'd like to be able to do:
POST http://eve-server/vehicles/
{
type: 'Boat',
manufacturer: 'Seadoo',
propeller_size: 2.0
}
POST http://eve-server/vehicles/
{
type: 'Airplane',
manufacturer: 'Boeing',
wing_span: 195.8
}
GET http://eve-server/vehicles/
[
{type: 'Boat', manufacturer: 'Seadoo', propeller_size: 2.0},
{type: 'Airplane', manufacturer: 'Boeing', wing_span: 195.8}
]
Does Eve/Cerberus support polymorphic types like this? If not, is it possible to plug in something like JSON Schema that supports this while maintaining referential integrity that data_relation
provides?