src/Graviton/SchemaBundle/Serializer/Handler/SchemaAdditionalPropertiesHandler.php
public function serializeSchemaAdditionalPropertiesToJson(
        JsonSerializationVisitor $visitor,
        SchemaAdditionalProperties $additionalProperties,
        array $type,
        Context $context
    ) {

        $properties = $additionalProperties->getProperties();

        // case for v4 schema
        if (is_bool($properties)) {
            return $visitor->visitBoolean($properties, [], $context);
        }

        // case for schema inside additionalProperties, swagger exclusive
        if ($properties instanceof Schema) {
            return $visitor->getNavigator()->accept(
                $properties,
                ['name' => 'Graviton\SchemaBundle\Document\Schema'],
                $context
            );
        }
    }
public function serializeSchemaAdditionalPropertiesToJson(
        JsonSerializationVisitor $visitor,
        SchemaAdditionalProperties $additionalProperties,
        array $type,
        Context $context
    ) {

        $properties = $additionalProperties->getProperties();

        // case for v4 schema
        if (is_bool($properties)) {
            return $visitor->visitBoolean($properties, [], $context);
        }

        // case for schema inside additionalProperties, swagger exclusive
        if ($properties instanceof Schema) {
            return $visitor->getNavigator()->accept(
                $properties,
                ['name' => 'Graviton\SchemaBundle\Document\Schema'],
                $context
            );
        }
    }
public function serializeSchemaAdditionalPropertiesToJson ( JsonSerializationVisitor $ visitor , SchemaAdditionalProperties $ additionalProperties , array $ type , Context $ context ) { $ properties = $ additionalProperties -> getProperties ( ) ; // case for v4 schema if ( is_bool ( $ properties ) ) { return $ visitor -> visitBoolean ( $ properties , [ ] , $ context ) ; } // case for schema inside additionalProperties, swagger exclusive if ( $ properties instanceof Schema ) { return $ visitor -> getNavigator ( ) -> accept ( $ properties , [ 'name' => 'Graviton\SchemaBundle\Document\Schema' ] , $ context ) ; } }
Serialize additionalProperties to JSON

@param JsonSerializationVisitor   $visitor              Visitor
@param SchemaAdditionalProperties $additionalProperties properties
@param array                      $type                 Type
@param Context                    $context              Context

@return string|null
Serialize additionalProperties to JSON