It looks like this package should be responsible for validating serialization styles defined in the specifications. It should prevent wrong styles chosen. So the abovementioned package can safely rely on the specification to use a correct style for deserialization.
New tests in ParameterTest.php:
testItValidatesSchemaAndContentCombination checks that both "content" and "schema" cannot be present
testItValidatesSupportedSerializationStyles checks that only certain serialization styles supported for each Parameter type.
testItValidatesContentCanHaveOnlySingleKey enforces this rule:
Why this PR is here. I am working on validation for incoming HTTP requests, containing serialized parameters: https://github.com/thephpleague/openapi-psr7-validator/issues/2
It looks like this package should be responsible for validating serialization styles defined in the specifications. It should prevent wrong styles chosen. So the abovementioned package can safely rely on the specification to use a correct style for deserialization.
New tests in
ParameterTest.php
:testItValidatesSchemaAndContentCombination
checks that both "content" and "schema" cannot be presenttestItValidatesSupportedSerializationStyles
checks that only certain serialization styles supported for each Parameter type.testItValidatesContentCanHaveOnlySingleKey
enforces this rule: