Skip to content

Commit 04dce52

Browse files
committed
fixed field types should be int
1 parent eec24e4 commit 04dce52

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

betterproto/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def py_type(
103103
message: DescriptorProto,
104104
descriptor: FieldDescriptorProto,
105105
) -> str:
106-
if descriptor.type in [1, 2, 6, 7, 15, 16]:
106+
if descriptor.type in [1, 2]:
107107
return "float"
108-
elif descriptor.type in [3, 4, 5, 13, 17, 18]:
108+
elif descriptor.type in [3, 4, 5, 6, 7, 13, 15, 16, 17, 18]:
109109
return "int"
110110
elif descriptor.type == 8:
111111
return "bool"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"foo": 4294967295,
3+
"bar": -2147483648,
4+
"baz": "18446744073709551615",
5+
"qux": "-9223372036854775808"
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
syntax = "proto3";
2+
3+
message Test {
4+
fixed32 foo = 1;
5+
sfixed32 bar = 2;
6+
fixed64 baz = 3;
7+
sfixed64 qux = 4;
8+
}

0 commit comments

Comments
 (0)