Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneof proto not generating as oneof #484

Closed
crwilcox opened this issue Jun 25, 2020 · 0 comments · Fixed by #485 or #1133
Closed

oneof proto not generating as oneof #484

crwilcox opened this issue Jun 25, 2020 · 0 comments · Fixed by #485 or #1133
Assignees
Labels
conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@crwilcox
Copy link
Contributor

crwilcox commented Jun 25, 2020

--- a/google/cloud/firestore_v1/types/document.py
+++ b/google/cloud/firestore_v1/types/document.py
@@ -128,19 +128,19 @@ class Value(proto.Message):
             A map value.
     """

-    null_value = proto.Field(proto.ENUM, number=11, enum=struct.NullValue,)
-    boolean_value = proto.Field(proto.BOOL, number=1)
-    integer_value = proto.Field(proto.INT64, number=2)
-    double_value = proto.Field(proto.DOUBLE, number=3)
+    null_value = proto.Field(proto.ENUM, number=11, enum=struct.NullValue, oneof="value_type")
+    boolean_value = proto.Field(proto.BOOL, number=1, oneof="value_type")
+    integer_value = proto.Field(proto.INT64, number=2, oneof="value_type")
+    double_value = proto.Field(proto.DOUBLE, number=3, oneof="value_type")
     timestamp_value = proto.Field(
-        proto.MESSAGE, number=10, message=timestamp.Timestamp,
+        proto.MESSAGE, number=10, message=timestamp.Timestamp, oneof="value_type"
     )
-    string_value = proto.Field(proto.STRING, number=17)
-    bytes_value = proto.Field(proto.BYTES, number=18)
-    reference_value = proto.Field(proto.STRING, number=5)
-    geo_point_value = proto.Field(proto.MESSAGE, number=8, message=latlng.LatLng,)
-    array_value = proto.Field(proto.MESSAGE, number=9, message="ArrayValue",)
-    map_value = proto.Field(proto.MESSAGE, number=6, message="MapValue",)
+    string_value = proto.Field(proto.STRING, number=17, oneof="value_type")
+    bytes_value = proto.Field(proto.BYTES, number=18, oneof="value_type")
+    reference_value = proto.Field(proto.STRING, number=5, oneof="value_type")
+    geo_point_value = proto.Field(proto.MESSAGE, number=8, message=latlng.LatLng, oneof="value_type")
+    array_value = proto.Field(proto.MESSAGE, number=9, message="ArrayValue", oneof="value_type")
+    map_value = proto.Field(proto.MESSAGE, number=6, message="MapValue", oneof="value_type")

Fix should be {% if field.oneof %}, oneof='{{ field.oneof }}'{% endif %} in https://github.com/googleapis/gapic-generator-python/blob/master/gapic/templates/%25namespace/%25name_%25version/%25sub/types/_message.py.j2

@crwilcox crwilcox self-assigned this Jun 25, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 26, 2020
@crwilcox crwilcox added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jun 26, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Jun 26, 2020
@crwilcox crwilcox removed their assignment Jun 26, 2020
@crwilcox crwilcox added the conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion label Jun 28, 2020
@crwilcox crwilcox self-assigned this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conversion blocking A surface delta, bug, missing feature, or other issue that prevents API conversion priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
2 participants