From 0c250bbb75140ca60294fef731f081ad8e44a3d3 Mon Sep 17 00:00:00 2001 From: Jun Mukai <86621109+junm-cloudnatix@users.noreply.github.com> Date: Mon, 13 Dec 2021 07:27:59 -0800 Subject: [PATCH] Add handling of IntOrString for other typescript variations. (#214) --- openapi/preprocess_spec.py | 4 +++- openapi/typescript-fetch.xml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openapi/preprocess_spec.py b/openapi/preprocess_spec.py index 47b6d09..abb5eb6 100644 --- a/openapi/preprocess_spec.py +++ b/openapi/preprocess_spec.py @@ -235,7 +235,9 @@ 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.startswith("typescript"): + # Checking with the prefix because there are variations of + # typescript generators (e.g. typescript-fetch, typescript-jquery). return ["intstr.IntOrString"] else: return [] diff --git a/openapi/typescript-fetch.xml b/openapi/typescript-fetch.xml index cd7b8fa..ef947bb 100644 --- a/openapi/typescript-fetch.xml +++ b/openapi/typescript-fetch.xml @@ -22,6 +22,9 @@ ${generator.spec.path} true typescript-fetch + + IntOrString=../../types + ${generator.output.path} true @@ -31,6 +34,7 @@ ${generator.client.version} original + int-or-string=IntOrString