Referring to Swagger's serialisation docs
Under the style:deepObject it specifies the following:
The behavior for nested objects and arrays is undefined.
It only states this on deepObject, however I suspect the behaviour would be undefined for all query parameters as RFC6570 has no comments on such data either.
I also suspect that path parameters will follow the same limitations.
Requirements to disallow this:
-
Schemas need to create new Schemas for defined items, properties and additionalProperties
-
Schemas need to provide access to the items, properties and additionalProperties
-
Because of the potential to get mixed up in allOf, anyOf and oneOf the Schema itself will need methods such as canItemsBe(Type), canPropertiesBe(Type) and canAdditionalPropertiesBe(Type) which recursively call the same methods on subSchemas.
-
Lastly the Parameter will be able to call these methods i.e.
if ($schema->canBe(Type::Array) && $schema->itemsCanBe(Type::Array)) {
// do something
}