public function hasSchema($schemaId)
    {
        $sql = '    SELECT COUNT(resp.id) AS cnt
                      FROM fusio_routes_response resp
                INNER JOIN fusio_routes_method method
                        ON resp.method_id = method.id
                INNER JOIN fusio_routes routes
                        ON routes.id = method.route_id
                     WHERE routes.status = 1
                       AND (method.parameters = :schema_id OR method.request = :schema_id OR resp.response = :schema_id)';

        $count = $this->connection->fetchColumn($sql, [
            'schema_id' => $schemaId,
        ]);

        return $count > 0;
    }