Fix google protobuf WellKnownTypes: Empty, Duration and Timestamp (#1231)

* Fix google protobuf WellKnownTypes: Timestamp and Duration

* Fix protobuf Empty

* .

* small refactor

* 006

* fix

* policy

* ---

* <PackageReference Include="ProtoBufJsonConverter" Version="0.7.0" />
This commit is contained in:
Stef Heyenrath
2025-01-09 18:50:16 +01:00
committed by GitHub
parent 9c94324cff
commit 44c1c7aaa8
15 changed files with 413 additions and 79 deletions

View File

@@ -1,33 +1,41 @@
// Copyright 2019 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package greet;
// The greeting service definition.
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
service Greeter {
// Sends a greeting
rpc SayNothing (google.protobuf.Empty) returns (google.protobuf.Empty);
rpc SayHello (HelloRequest) returns (HelloReply);
rpc SayEmpty (MyMessageEmpty) returns (MyMessageEmpty);
rpc SayTimestamp (MyMessageTimestamp) returns (MyMessageTimestamp);
rpc SayDuration (MyMessageDuration) returns (MyMessageDuration);
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
enum PhoneType {
none = 0;
mobile = 1;
home = 2;
}
PhoneType phoneType = 2;
}
message MyMessageTimestamp {
google.protobuf.Timestamp ts = 1;
}
message MyMessageDuration {
google.protobuf.Duration du = 1;
}
message MyMessageEmpty {
google.protobuf.Empty e = 1;
}