public static function createFromArray($key, array $data = [], ApiDefinition $apiDefinition = null)
    {
        $securityScheme = new static($key === 'null' ? null : $key);

        if (isset($data['description'])) {
            $securityScheme->setDescription($data['description']);
        }

        if (isset($data['type'])) {
            $securityScheme->setType($data['type']);
        }

        if (isset($data['describedBy'])) {
            $securityScheme->setDescribedBy(
                SecuritySchemeDescribedBy::createFromArray('describedBy', $data['describedBy'])
            );
        }

        if (isset($data['settings'])) {
            $securityScheme->setSettings($data['settings']);
        }

        return $securityScheme;
    }