Skip to content

Commit 8eeaca1

Browse files
committed
update schema-sdk, apply jsonpatch
1 parent 58b4ffd commit 8eeaca1

File tree

6 files changed

+50
-8
lines changed

6 files changed

+50
-8
lines changed

packages/kubernetesjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
"test:deploy": "ts-node scripts/deploy.ts"
5151
},
5252
"devDependencies": {
53-
"schema-sdk": "^0.11.3"
53+
"schema-sdk": "^0.12.0"
5454
}
5555
}

packages/kubernetesjs/scripts/codegen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ const options = getDefaultSchemaSDKOptions({
1313
'io.k8s.api.events.v1.Event',
1414
'io.k8s.api.flowcontrol*',
1515
],
16+
jsonpatch: [
17+
{
18+
op: 'remove',
19+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/type'
20+
},
21+
{
22+
op: 'remove',
23+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/format'
24+
},
25+
{
26+
op: 'add',
27+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/oneOf',
28+
value: [
29+
{ type: 'string' },
30+
{ type: 'integer', format: 'int32' }
31+
]
32+
}
33+
]
1634
});
1735
const code = generateOpenApiClient(
1836
{

packages/kubernetesjs/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5818,7 +5818,7 @@ export type RawExtension = {
58185818
};
58195819
/* io.k8s.apimachinery.pkg.util.intstr.IntOrString */
58205820
/* IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number. */
5821-
export type IntOrString = string;
5821+
export type IntOrString = string | number;
58225822
/* io.k8s.apimachinery.pkg.version.Info */
58235823
/* Info contains versioning information. how we'll want to distribute that information. */
58245824
export interface Info {
@@ -13760,7 +13760,7 @@ export interface LogFileHandlerRequest {
1376013760
export interface GetServiceAccountIssuerOpenIDKeysetRequest {}
1376113761
export interface GetCodeVersionRequest {}
1376213762
export class KubernetesClient extends APIClient {
13763-
constructor(options: any) {
13763+
constructor(options) {
1376413764
super(options);
1376513765
}
1376613766
async getSwaggerJSON() {

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"devDependencies": {
5858
"@types/react": "^18.2.77",
5959
"react": "^18.2.0",
60-
"schema-sdk": "^0.11.3"
60+
"schema-sdk": "^0.12.0"
6161
},
6262
"peerDependencies": {
6363
"@tanstack/react-query": "5.79.2",

packages/react/scripts/codegen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ const options = getDefaultSchemaSDKOptions({
1313
'io.k8s.api.events.v1.Event',
1414
'io.k8s.api.flowcontrol*',
1515
],
16+
jsonpatch: [
17+
{
18+
op: 'remove',
19+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/type'
20+
},
21+
{
22+
op: 'remove',
23+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/format'
24+
},
25+
{
26+
op: 'add',
27+
path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/oneOf',
28+
value: [
29+
{ type: 'string' },
30+
{ type: 'integer', format: 'int32' }
31+
]
32+
}
33+
]
1634
});
1735
const openApiOptions = {
1836
...options,

yarn.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2761,6 +2761,11 @@ fast-glob@^3.2.9:
27612761
merge2 "^1.3.0"
27622762
micromatch "^4.0.8"
27632763

2764+
fast-json-patch@^3.1.1:
2765+
version "3.1.1"
2766+
resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947"
2767+
integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==
2768+
27642769
fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
27652770
version "2.1.0"
27662771
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
@@ -5821,16 +5826,17 @@ safe-buffer@~5.2.0:
58215826
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
58225827
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
58235828

5824-
schema-sdk@^0.11.3:
5825-
version "0.11.3"
5826-
resolved "https://registry.yarnpkg.com/schema-sdk/-/schema-sdk-0.11.3.tgz#cea5d1bf747e04824a8a848af8d2c51990b16b2f"
5827-
integrity sha512-clsw2kq2jkXAEhVw7qc1vV1xVBNUSbDc9OqhxU69XlKtiZaOfjz1viPB1FAFW4vFBM98YTzKNDDPA/jEh5Rr8A==
5829+
schema-sdk@^0.12.0:
5830+
version "0.12.0"
5831+
resolved "https://registry.yarnpkg.com/schema-sdk/-/schema-sdk-0.12.0.tgz#3d57e5b8642636011ab2c16479a3b019849a9cab"
5832+
integrity sha512-Za2kaXpanSioGqkK4cRe/epndQkJc6a037EcJ6ZrvhoFs6N9IW9IRT/IVEv7J0bpyR4WGloB2yk4w+/eSUkMdg==
58285833
dependencies:
58295834
"@babel/generator" "^7.24.4"
58305835
"@babel/types" "^7.24.0"
58315836
"@interweb-utils/casing" "^0.2.0"
58325837
"@interweb/fetch-api-client" "^0.6.1"
58335838
deepmerge "^4.3.1"
5839+
fast-json-patch "^3.1.1"
58345840
schema-typescript "^0.12.1"
58355841

58365842
schema-typescript@^0.12.1:

0 commit comments

Comments
 (0)