From 9fa31bd034f63424ab8910d998d9afd8a4411cd5 Mon Sep 17 00:00:00 2001 From: philippeitis <33013301+philippeitis@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:44:48 -0700 Subject: [PATCH] Don't call .to_string() on string values --- src/generator/lib/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/generator/lib/util.py b/src/generator/lib/util.py index d25476c56d..7e766a2e17 100644 --- a/src/generator/lib/util.py +++ b/src/generator/lib/util.py @@ -1222,8 +1222,9 @@ def string_impl(p): "byte": lambda x: f"::client::serde::urlsafe_base64::to_string(&{x})", "google-datetime": lambda x: f"::client::serde::datetime_to_string(&{x})", "date-time": lambda x: f"::client::serde::datetime_to_string(&{x})", - "google-fieldmask": lambda x: f"{x}.to_string()" - }.get(p.get("format"), lambda x: f"{x}.to_string()") + "google-fieldmask": lambda x: f"{x}.to_string()", + "string": lambda x: x + }.get(p.get("format", p["type"]), lambda x: f"{x}.to_string()") if __name__ == '__main__':