Repository: IBM/py-to-proto (language: python)

Issue:
✨ Add support for int64
## Is your feature request related to a problem? Please describe.

While [explicitly not supported by JTD](https://www.rfc-editor.org/rfc/rfc8927#section-a.1), protobuf [does support `int64` and `uint64` types](https://developers.google.com/protocol-buffers/docs/proto3). Since the usage of JTD here is only for schema management, the reasons given in the JTD RFC don't apply, and we can safely extend `jtd_to_proto` to allow for `int64` and `uint64`.

## Describe the solution you'd like

Add `int64` and `uint64` to [the JTD to proto type map](https://github.com/IBM/jtd-to-proto/blob/main/jtd_to_proto/jtd_to_proto.py#L53)

## Describe alternatives you've considered

Stick with `int32`. The reason to not do this is that on 64-bit machines, python's built in `int` is an `int64`, so supporting an `int64` in `jtd_to_proto` will allow us to avoid higher-order errors with mapping `int` -> `int64` -> `TYPE_INT64`.

feat:Introduce support for Int64 and UInt64 for protobuf
Fixes #11 

Verified Tests locally:

![image](https://user-images.githubusercontent.com/7208041/199119594-c47ff0e9-ccb4-4a07-bcaf-b4827216b731.png)



Discussion / hints:

@gabe-l-hart Not quite sure but I figured this was the expected outcome of the issue? Let me know if I misunderstood. 
> Thanks for the contribution @viveknshah! Minor NIT on the spacing which you can fix by running `make fmt` in the base of the repo. Also, IBM's org enforces signed commits, so you can do the following to sign: `git fetch origin && git rebase origin/main --signoff`.
> 
> Finally, it would be great to add a quick unit test to explicitly verify that the new types are supported. We've still got 100% coverage as is since the dict is declared, but it would be great to ensure that nothing breaks in the JTD validation. The test would look a lot like [this one](https://github.com/IBM/jtd-to-proto/pull/6/files#diff-93d9a184f67d4a3847d6e06f9fb74e45afcf4404e74320076ec07a039071c0dfR597).

Thank you for your patient feedback. Have made the appropriate formating flows, verified the added tests and followed the signed commit command. 

Fix patch:
diff --git a/jtd_to_proto/jtd_to_proto.py b/jtd_to_proto/jtd_to_proto.py
index c6089a1..63e6a8d 100644
--- a/jtd_to_proto/jtd_to_proto.py
+++ b/jtd_to_proto/jtd_to_proto.py
@@ -49,6 +49,8 @@ def _to_upper_camel(snake_str: str) -> str:
     "uint8": _descriptor.FieldDescriptor.TYPE_UINT32,
     "int32": _descriptor.FieldDescriptor.TYPE_INT32,
     "uint32": _descriptor.FieldDescriptor.TYPE_UINT32,
+    "int64": _descriptor.FieldDescriptor.TYPE_INT64,
+    "uint64": _descriptor.FieldDescriptor.TYPE_UINT64,
     # Not strictly part of the JTD spec, but important for protobuf messages
     "bytes": _descriptor.FieldDescriptor.TYPE_BYTES,
 }


Test patch:
diff --git a/tests/test_jtd_to_proto.py b/tests/test_jtd_to_proto.py
index 643d3e2..dbd2003 100644
--- a/tests/test_jtd_to_proto.py
+++ b/tests/test_jtd_to_proto.py
@@ -608,6 +608,34 @@ def test_jtd_to_proto_bytes():
     assert bytes_field.type == bytes_field.TYPE_BYTES
 
 
+def test_jtd_to_proto_int64():
+    """Make sure that fields can have type int64 and that the messages can be
+    validated.
+    """
+    int64_descriptor = jtd_to_proto(
+        "HasInt64",
+        "foo.bar",
+        {"properties": {"foo": {"type": "int64"}}},
+        validate_jtd=True,
+    )
+    int64_field = int64_descriptor.fields_by_name["foo"]
+    assert int64_field.type == int64_field.TYPE_INT64
+
+
+def test_jtd_to_proto_uint64():
+    """Make sure that fields can have type uint64 and that the messages can be
+    validated.
+    """
+    uint64_descriptor = jtd_to_proto(
+        "HasUInt64",
+        "foo.bar",
+        {"properties": {"foo": {"type": "uint64"}}},
+        validate_jtd=True,
+    )
+    uint64_field = uint64_descriptor.fields_by_name["foo"]
+    assert uint64_field.type == uint64_field.TYPE_UINT64
+
+
 ## Error Cases #################################################################