From ea5af85f5bb75934bf7f3eb1edab1643e8caab47 Mon Sep 17 00:00:00 2001
From: Jun Mukai <86621109+junm-cloudnatix@users.noreply.github.com>
Date: Mon, 5 Dec 2022 08:59:05 -0800
Subject: [PATCH] Fix the handling of IntOrString. (#233)
IntOrString has been considered to be 'object' in typescript-fetch,
but it should be specially handled. This allows a similar handling
done in typescript.xml.
---
openapi/preprocess_spec.py | 2 +-
openapi/typescript-fetch.xml | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/openapi/preprocess_spec.py b/openapi/preprocess_spec.py
index a92b568..fdda133 100644
--- a/openapi/preprocess_spec.py
+++ b/openapi/preprocess_spec.py
@@ -239,7 +239,7 @@ def preserved_primitives_for_language(client_language):
return ["intstr.IntOrString", "resource.Quantity", "v1.Patch"]
elif client_language == "haskell-http-client":
return ["intstr.IntOrString", "resource.Quantity"]
- elif client_language == "typescript":
+ elif client_language in ["typescript", "typescript-fetch"]:
return ["intstr.IntOrString", "v1.MicroTime"]
elif client_language == "c":
return ["intstr.IntOrString"]
diff --git a/openapi/typescript-fetch.xml b/openapi/typescript-fetch.xml
index fe11a4a..2c76858 100644
--- a/openapi/typescript-fetch.xml
+++ b/openapi/typescript-fetch.xml
@@ -32,6 +32,7 @@
${generator.client.version}
original
+ int-or-string=IntOrString