Почему мои дополнительные_привязки не работают для транскодирования gRPC с ESP? - PullRequest
0 голосов
/ 17 июня 2019

Я использую прокси расширяемого сервиса Google для транскодирования между gRPC и REST для моего API.

У меня есть RPC, который выглядит так:

// Get a portfolio by ID.
rpc GetPortfolio(PortfolioId) returns (Portfolio) {
    option (google.api.http) = {
        get: "/v1/portfolios/{own_id.uuid}"
        additional_bindings {
            get: "/v1/organisations/{organisation_id.uuid}/portfolio"
        }
        additional_bindings {
            get: "/v1/nations/{nation_id.uuid}/portfolio"
        }
        additional_bindings {
            get: "/v1/associations/{association_id.uuid}"
        }
    };
}

и сообщение PortfolioId выглядит так:

// A resource used to identify portfolios
// User-generated portfolios have their own ID
// Organisational and national portfolios connect to the organisation or nation respectively
// WGA and SIL portfolios are both singletons and can be identified by booleans
// The way in which a portfolio is identified also indicates which type of portfolio it is.
message PortfolioId {
    // To identify a portfolio no more than one of these will be set
    oneof id {
        // The user-generated portfolio ID
        Id own_id = 5;
        // The ID of the organisation the organisational portfolio is for
        Id organisation_id = 7;
        // The ID of the nation the national portfolio is for
        Id nation_id = 9;
        // The ID of the association the association portfolio is for
        Id association_id = 12;
    }
}

Часть аннотаций additional_bindings не работает. Он не отображается на моем портале для разработчиков, и когда я пытаюсь их использовать, я получаю ошибку method does not exist.

Первая привязка get: "/v1/portfolios/{own_id.uuid}" работает.

Я что-то не так делаю?

ESP идет отсюда: gcr.io/endpoints-release/endpoints-runtime:1.32

...