public function denormalize($data, $class, $format = null, array $context = [])
{
if (isset($data->{'$ref'})) {
return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
}
$object = new \Joli\Jane\OpenApi\Model\QueryParameterSubSchema();
if (!isset($context['rootSchema'])) {
$context['rootSchema'] = $object;
}
if (property_exists($data, 'required')) {
$object->setRequired($data->{'required'});
}
if (property_exists($data, 'in')) {
$object->setIn($data->{'in'});
}
if (property_exists($data, 'description')) {
$object->setDescription($data->{'description'});
}
if (property_exists($data, 'name')) {
$object->setName($data->{'name'});
}
if (property_exists($data, 'allowEmptyValue')) {
$object->setAllowEmptyValue($data->{'allowEmptyValue'});
}
if (property_exists($data, 'type')) {
$object->setType($data->{'type'});
}
if (property_exists($data, 'format')) {
$object->setFormat($data->{'format'});
}
if (property_exists($data, 'items')) {
$object->setItems($this->serializer->deserialize($data->{'items'}, 'Joli\\Jane\\OpenApi\\Model\\PrimitivesItems', 'raw', $context));
}
if (property_exists($data, 'collectionFormat')) {
$object->setCollectionFormat($data->{'collectionFormat'});
}
if (property_exists($data, 'default')) {
$object->setDefault($data->{'default'});
}
if (property_exists($data, 'maximum')) {
$object->setMaximum($data->{'maximum'});
}
if (property_exists($data, 'exclusiveMaximum')) {
$object->setExclusiveMaximum($data->{'exclusiveMaximum'});
}
if (property_exists($data, 'minimum')) {
$object->setMinimum($data->{'minimum'});
}
if (property_exists($data, 'exclusiveMinimum')) {
$object->setExclusiveMinimum($data->{'exclusiveMinimum'});
}
if (property_exists($data, 'maxLength')) {
$object->setMaxLength($data->{'maxLength'});
}
if (property_exists($data, 'minLength')) {
$object->setMinLength($data->{'minLength'});
}
if (property_exists($data, 'pattern')) {
$object->setPattern($data->{'pattern'});
}
if (property_exists($data, 'maxItems')) {
$object->setMaxItems($data->{'maxItems'});
}
if (property_exists($data, 'minItems')) {
$object->setMinItems($data->{'minItems'});
}
if (property_exists($data, 'uniqueItems')) {
$object->setUniqueItems($data->{'uniqueItems'});
}
if (property_exists($data, 'enum')) {
$values = [];
foreach ($data->{'enum'} as $value) {
$values[] = $value;
}
$object->setEnum($values);
}
if (property_exists($data, 'multipleOf')) {
$object->setMultipleOf($data->{'multipleOf'});
}
return $object;
}