lnrpc: split REST annotations into service files

As a preparation for the migration to the grpc-gateway/v2 library we
declare each service's REST annotations in its own file. This is
optional in the v1 library but mandatory in v2.
This commit is contained in:
Oliver Gugger committed 2021-07-27 12:59:52 +02:00
1 parent d3973c9b49
commit 4a0025c1b7
15 files changed
+381 -343

No files matched your search

+3 -2
View File
@@ -20,14 +20,15 @@ function generate() {
"${file}"
# Generate the REST reverse proxy.
annotationsFile=${file//proto/yaml}
protoc -I/usr/local/include -I. \
--grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=rest-annotations.yaml:. \
--grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=${annotationsFile}:. \
"${file}"
# Finally, generate the swagger file which describes the REST API in detail.
protoc -I/usr/local/include -I. \
--swagger_out=logtostderr=true,grpc_api_configuration=rest-annotations.yaml:. \
--swagger_out=logtostderr=true,grpc_api_configuration=${annotationsFile}:. \
"${file}"
done
}