-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pandaproxy/sr: protobuf rendering: add test for message oneofs normal…
…ization ordering (cherry picked from commit 3e4e26a)
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/v/pandaproxy/schema_registry/test/testdata/protobuf/oneof_ordering_input.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
syntax = "proto3"; | ||
|
||
// Oneof fields should be ordered by their index, regardless | ||
// of what field values they have internally. Fields internally | ||
// are safe to reorder | ||
|
||
message OneofsMessage { | ||
oneof first_oneof { | ||
float third_f = 7; | ||
double third_d = 3; | ||
} | ||
double d = 6; | ||
uint32 ui32 = 5; | ||
int64 i64 = 4; | ||
oneof second_oneof { | ||
float second_f = 8; | ||
double second_d = 2; | ||
} | ||
oneof third_oneof { | ||
float first_f = 9; | ||
double first_d = 1; | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
src/v/pandaproxy/schema_registry/test/testdata/protobuf/oneof_ordering_normalized.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
|
||
message OneofsMessage { | ||
int64 i64 = 4; | ||
uint32 ui32 = 5; | ||
double d = 6; | ||
oneof first_oneof { | ||
double third_d = 3; | ||
float third_f = 7; | ||
} | ||
oneof second_oneof { | ||
double second_d = 2; | ||
float second_f = 8; | ||
} | ||
oneof third_oneof { | ||
double first_d = 1; | ||
float first_f = 9; | ||
} | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
src/v/pandaproxy/schema_registry/test/testdata/protobuf/oneof_ordering_sanitized.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
|
||
message OneofsMessage { | ||
oneof first_oneof { | ||
float third_f = 7; | ||
double third_d = 3; | ||
} | ||
double d = 6; | ||
uint32 ui32 = 5; | ||
int64 i64 = 4; | ||
oneof second_oneof { | ||
float second_f = 8; | ||
double second_d = 2; | ||
} | ||
oneof third_oneof { | ||
float first_f = 9; | ||
double first_d = 1; | ||
} | ||
} | ||
|