@@ -52,6 +52,49 @@ service MyService {
52
52
rpc SyncEmpty (.google.protobuf.Empty) returns (.google.protobuf.Empty);
53
53
rpc Unary (MyRequest) returns (MyResponse);
54
54
}
55
+ " , schema , ignoreLineEndingDifferences : true ) ;
56
+ }
57
+
58
+ [ Fact ]
59
+ public void CheckIngeritedInterfaceSchema ( )
60
+ {
61
+ var generator = new SchemaGenerator ( ) ;
62
+ var schema = generator . GetSchema < IMyInheritedService > ( ) ;
63
+ Log ( schema ) ;
64
+ Assert . Equal ( @"syntax = ""proto3"";
65
+ package protobuf_net.Grpc.Reflection.Test;
66
+ import ""google/protobuf/empty.proto"";
67
+ import ""google/protobuf/timestamp.proto"";
68
+
69
+ enum Category {
70
+ Default = 0;
71
+ Foo = 1;
72
+ Bar = 2;
73
+ }
74
+ message MyRequest {
75
+ int32 Id = 1;
76
+ .google.protobuf.Timestamp When = 2;
77
+ }
78
+ message MyResponse {
79
+ string Value = 1;
80
+ Category Category = 2;
81
+ string RefId = 3; // default value could not be applied: 00000000-0000-0000-0000-000000000000
82
+ }
83
+ service MyInheritedService {
84
+ rpc AsyncEmpty (.google.protobuf.Empty) returns (.google.protobuf.Empty);
85
+ rpc ClientStreaming (stream MyRequest) returns (MyResponse);
86
+ rpc FullDuplex (stream MyRequest) returns (stream MyResponse);
87
+ rpc GenericUnary (MyRequest) returns (MyResponse);
88
+ rpc InheritedAsyncEmpty (.google.protobuf.Empty) returns (.google.protobuf.Empty);
89
+ rpc InheritedClientStreaming (stream MyRequest) returns (MyResponse);
90
+ rpc InheritedFullDuplex (stream MyRequest) returns (stream MyResponse);
91
+ rpc InheritedServerStreaming (MyRequest) returns (stream MyResponse);
92
+ rpc InheritedSyncEmpty (.google.protobuf.Empty) returns (.google.protobuf.Empty);
93
+ rpc InheritedUnary (MyRequest) returns (MyResponse);
94
+ rpc ServerStreaming (MyRequest) returns (stream MyResponse);
95
+ rpc SyncEmpty (.google.protobuf.Empty) returns (.google.protobuf.Empty);
96
+ rpc Unary (MyRequest) returns (MyResponse);
97
+ }
55
98
" , schema , ignoreLineEndingDifferences : true ) ;
56
99
}
57
100
@@ -67,6 +110,24 @@ public interface IMyService
67
110
void SyncEmpty ( ) ;
68
111
}
69
112
113
+ [ Service ]
114
+ public interface ISomeGenericService < TGenericRequest , TGenericResult >
115
+ {
116
+ ValueTask < TGenericResult > GenericUnary ( TGenericRequest request , CallContext callContext = default ) ;
117
+ }
118
+
119
+ [ Service ]
120
+ public interface IMyInheritedService : IMyService , ISomeGenericService < MyRequest , MyResponse >
121
+ {
122
+ ValueTask < MyResponse > InheritedUnary ( MyRequest request , CallContext callContext = default ) ;
123
+ ValueTask < MyResponse > InheritedClientStreaming ( IAsyncEnumerable < MyRequest > request , CallContext callContext = default ) ;
124
+ IAsyncEnumerable < MyResponse > InheritedServerStreaming ( MyRequest request , CallContext callContext = default ) ;
125
+ IAsyncEnumerable < MyResponse > InheritedFullDuplex ( IAsyncEnumerable < MyRequest > request , CallContext callContext = default ) ;
126
+
127
+ ValueTask InheritedAsyncEmpty ( ) ;
128
+ void InheritedSyncEmpty ( ) ;
129
+ }
130
+
70
131
[ DataContract ]
71
132
public class MyRequest
72
133
{
0 commit comments