Skip to content

Commit d60c5f1

Browse files
author
uesyn
committed
patches for v1.MicroTime
1 parent 0427fdb commit d60c5f1

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/generate-javascript.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
git clone https://github.com/kubernetes-client/gen
3030
pushd gen
3131
git checkout "${{ github.event.inputs.genCommit }}"
32+
patch -p1 < ../patches/microtime.patch
3233
- name: Generate Branch Name
3334
run: |
3435
SUFFIX=$(openssl rand -hex 4)

patches/microtime.patch

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
diff --git a/openapi/preprocess_spec.py b/openapi/preprocess_spec.py
2+
index 47b6d09..bcc56d6 100644
3+
--- a/openapi/preprocess_spec.py
4+
+++ b/openapi/preprocess_spec.py
5+
@@ -236,7 +236,7 @@ def preserved_primitives_for_language(client_language):
6+
elif client_language == "haskell-http-client":
7+
return ["intstr.IntOrString", "resource.Quantity"]
8+
elif client_language == "typescript":
9+
- return ["intstr.IntOrString"]
10+
+ return ["intstr.IntOrString", "v1.MicroTime"]
11+
else:
12+
return []
13+
14+
@@ -254,6 +254,8 @@ def format_for_language(client_language):
15+
def type_for_language(client_language):
16+
if client_language == "java":
17+
return {"v1.Patch": { "type": "string"}}
18+
+ elif client_language == "typescript":
19+
+ return {"v1.MicroTime": { "type": "string", "format": "date-time-micro" }}
20+
elif client_language == "csharp":
21+
return {
22+
"v1.Patch": { "type": "object", "properties": {"content": { "type": "object"}} },
23+
diff --git a/openapi/typescript.xml b/openapi/typescript.xml
24+
index 90db5fc..fe3c391 100644
25+
--- a/openapi/typescript.xml
26+
+++ b/openapi/typescript.xml
27+
@@ -23,7 +23,7 @@
28+
<skipValidateSpec>true</skipValidateSpec>
29+
<generatorName>typescript-node</generatorName>
30+
<importMappings>
31+
- IntOrString=../../types
32+
+ IntOrString=../../types,V1MicroTime=../../types
33+
</importMappings>
34+
<output>${generator.output.path}</output>
35+
<configOptions>
36+
@@ -33,7 +33,7 @@
37+
<npmVersion>${generator.client.version}</npmVersion>
38+
<modelPropertyNaming>original</modelPropertyNaming>
39+
</configOptions>
40+
- <typeMappings>int-or-string=IntOrString</typeMappings>
41+
+ <typeMappings>int-or-string=IntOrString,date-time-micro=V1MicroTime</typeMappings>
42+
</configuration>
43+
</execution>
44+
</executions>

0 commit comments

Comments
 (0)