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.
This commit is contained in:
Jun Mukai
2022-12-05 08:59:05 -08:00
committed by GitHub
parent 0ffb80637b
commit ea5af85f5b
2 changed files with 2 additions and 1 deletions

View File

@@ -239,7 +239,7 @@ def preserved_primitives_for_language(client_language):
return ["intstr.IntOrString", "resource.Quantity", "v1.Patch"] return ["intstr.IntOrString", "resource.Quantity", "v1.Patch"]
elif client_language == "haskell-http-client": elif client_language == "haskell-http-client":
return ["intstr.IntOrString", "resource.Quantity"] return ["intstr.IntOrString", "resource.Quantity"]
elif client_language == "typescript": elif client_language in ["typescript", "typescript-fetch"]:
return ["intstr.IntOrString", "v1.MicroTime"] return ["intstr.IntOrString", "v1.MicroTime"]
elif client_language == "c": elif client_language == "c":
return ["intstr.IntOrString"] return ["intstr.IntOrString"]

View File

@@ -32,6 +32,7 @@
<npmVersion>${generator.client.version}</npmVersion> <npmVersion>${generator.client.version}</npmVersion>
<modelPropertyNaming>original</modelPropertyNaming> <modelPropertyNaming>original</modelPropertyNaming>
</configOptions> </configOptions>
<typeMappings>int-or-string=IntOrString</typeMappings>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>