In quarkus, is there a way to add a simple annotation, to expose underlying gRPC implementation as REST/json also? I.e two views with one implementation.
Springboot seem to have ProtobufJsonFormatHttpMessageConverter.
https://medium.com/@thinhda/build-service-that-provides-http-and-grpc-api-with-spring-9e7cff7aa17a
I belive proto syntax allows annotation for rest endpoint
syntax = "proto3";
package pn.api;
//import "google/protobuf/timestamp.proto";
//import "google/api/annotations.proto";
option java_package = "pn.api.protobuf";
option java_outer_classname = "Proto";
service SearchService{
rpc search(SearchRequest) returns (SearchResponse){
// option (google.api.http) = { get: "/v1/search/{queryObj}" };
};
}
No.
There is no way to do it. If you think that's beneficial, feel free to create an issue in Github Issues (https://github.com/quarkusio/quarkus/issues) and we can discuss it there. In the issue, please focus on what would be a benefit of adding such a feature.