uglyog
Sri Naga Sai Krishna Sanka
09/29/2022, 3:00 PMuglyog
Sri Naga Sai Krishna Sanka
10/04/2022, 6:01 PMuglyog
0.1.15
has been released with fixes for the enums and embedded messages typesJason Army
10/05/2022, 9:34 PMJason Army
10/06/2022, 7:19 PM"ad_break_type", AdBreakAdType.AUDIO_AD_BREAK
Jason Army
10/06/2022, 8:29 PMad_break_type
and when I run the pact_verifier_cli
, the provider complains with this error: com.pandora.delivery.dispatch.api.exception.InvalidRequestParameterException: Invalid Request Parameter: AdBreakAdType is missing or invalid
I've attached the generated contractuglyog
Jason Army
10/07/2022, 3:36 PM"ad_break_type", "matching(type, 'AUDIO_AD_BREAK')"
I get this error: Failed to process protobuf: Protobuf enum value .delivery.dispatch.AdBreakAdType has no value AUDIO_AD_BREAK
Jason Army
10/07/2022, 3:37 PMuglyog
Sri Naga Sai Krishna Sanka
10/09/2022, 10:37 PM.json
file @Jason Army has provideduglyog
Sri Naga Sai Krishna Sanka
10/10/2022, 4:13 PMuglyog
Jason Army
10/11/2022, 4:56 PM0.1.15
Jason Taylor
10/31/2022, 4:57 PMJason Taylor
11/01/2022, 2:11 PMProtobuf enum value .authz.v2.EnforceEffect has no value ENFORCE_EFFECT_ALLOW
Jason Taylor
11/01/2022, 2:54 PMuglyog
uglyog
Jason Taylor
11/03/2022, 8:53 PMJason Taylor
11/03/2022, 9:00 PM"result": "TEST_TWO"
it works if i put the enum def inside the message. but if enum is outside it fails
enum TestEnum {
TEST_ONE = 0;
TEST_TWO = 1;
TEST_THREE = 2;
}
message TestResponse {
TestEnum result = 1;
}
uglyog
Jason Taylor
11/03/2022, 10:13 PMuglyog
"result": "TEST_TWO"
and "result": "matching(type, 'TEST_TWO')"
Jason Taylor
11/03/2022, 10:52 PMJason Taylor
11/03/2022, 11:24 PMJason Taylor
11/04/2022, 3:18 PM.v2
, but then was also seeing additional odd behavior when I transferred the enum to route_guide. The file below is not hitting the enum issue with`"pact:proto-service": "RouteGuide/GetFeature"` but fails with "pact:proto-service": "Test/GetFeature2"
. Dropping the .v2
or moving the enum into the message makes the second case work.
// Copyright 2015 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 routeguide.v2;
enum TestEnum {
VALUE_ZERO = 0;
VALUE_ONE = 1;
VALUE_TWO = 2;
}
// Points are represented as latitude-longitude pairs in the E7 representation
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive).
message Point {
int32 latitude = 1;
int32 longitude = 2;
}
// A latitude-longitude rectangle, represented as two diagonally opposite
// points "lo" and "hi".
message Rectangle {
// One corner of the rectangle.
Point lo = 1;
// The other corner of the rectangle.
Point hi = 2;
}
// A feature names something at a given point.
//
// If a feature could not be named, the name is empty.
message Feature {
TestEnum result = 1;
}
// A RouteNote is a message sent while at a given point.
message RouteNote {
// The location from which the message is sent.
Point location = 1;
// The message to be sent.
string message = 2;
}
// A RouteSummary is received in response to a RecordRoute rpc.
//
// It contains the number of individual points received, the number of
// detected features, and the total distance covered as the cumulative sum of
// the distance between each point.
message RouteSummary {
// The number of points received.
int32 point_count = 1;
// The number of known features passed while traversing the route.
int32 feature_count = 2;
// The distance covered in metres.
int32 distance = 3;
// The duration of the traversal in seconds.
int32 elapsed_time = 4;
}
// Interface exported by the server.
service Test {
// A simple RPC.
//
// Obtains the feature at a given position.
//
// A feature with an empty name is returned if there's no feature at the given
// position.
rpc GetFeature2(Point) returns (Feature) {}
// A server-to-client streaming RPC.
//
// Obtains the Features available within the given Rectangle. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field), as the rectangle may cover a large area and contain a
// huge number of features.
rpc ListFeatures(Rectangle) returns (stream Feature) {}
// A client-to-server streaming RPC.
//
// Accepts a stream of Points on a route being traversed, returning a
// RouteSummary when traversal is completed.
rpc RecordRoute(stream Point) returns (RouteSummary) {}
// A Bidirectional streaming RPC.
//
// Accepts a stream of RouteNotes sent while a route is being traversed,
// while receiving other RouteNotes (e.g. from other users).
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
}
uglyog