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
            );
        }
    }