diff --git a/packages/kubernetesjs/package.json b/packages/kubernetesjs/package.json index 53ff521..4a68edd 100644 --- a/packages/kubernetesjs/package.json +++ b/packages/kubernetesjs/package.json @@ -50,6 +50,6 @@ "test:deploy": "ts-node scripts/deploy.ts" }, "devDependencies": { - "schema-sdk": "^0.11.3" + "schema-sdk": "^0.12.0" } } diff --git a/packages/kubernetesjs/scripts/codegen.ts b/packages/kubernetesjs/scripts/codegen.ts index e7dfe76..0f09a57 100644 --- a/packages/kubernetesjs/scripts/codegen.ts +++ b/packages/kubernetesjs/scripts/codegen.ts @@ -13,6 +13,24 @@ const options = getDefaultSchemaSDKOptions({ 'io.k8s.api.events.v1.Event', 'io.k8s.api.flowcontrol*', ], + jsonpatch: [ + { + op: 'remove', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/type' + }, + { + op: 'remove', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/format' + }, + { + op: 'add', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/oneOf', + value: [ + { type: 'string' }, + { type: 'integer', format: 'int32' } + ] + } + ] }); const code = generateOpenApiClient( { diff --git a/packages/kubernetesjs/src/index.ts b/packages/kubernetesjs/src/index.ts index 6a88d59..7e82734 100644 --- a/packages/kubernetesjs/src/index.ts +++ b/packages/kubernetesjs/src/index.ts @@ -1,4 +1,4 @@ -import { APIClient, APIClientRequestOpts } from "./client"; +import { APIClient, APIClientOptions, APIClientRequestOpts } from "./client"; /* io.k8s.api.admissionregistration.v1.MutatingWebhook */ /* MutatingWebhook describes an admission webhook and the resources and operations it applies to. */ export interface MutatingWebhook { @@ -5818,7 +5818,7 @@ export type RawExtension = { }; /* io.k8s.apimachinery.pkg.util.intstr.IntOrString */ /* 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. */ -export type IntOrString = string; +export type IntOrString = string | number; /* io.k8s.apimachinery.pkg.version.Info */ /* Info contains versioning information. how we'll want to distribute that information. */ export interface Info { @@ -13760,7 +13760,7 @@ export interface LogFileHandlerRequest { export interface GetServiceAccountIssuerOpenIDKeysetRequest {} export interface GetCodeVersionRequest {} export class KubernetesClient extends APIClient { - constructor(options: any) { + constructor(options: APIClientOptions) { super(options); } async getSwaggerJSON() { diff --git a/packages/react/package.json b/packages/react/package.json index d6934b7..ff146b7 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -57,7 +57,7 @@ "devDependencies": { "@types/react": "^18.2.77", "react": "^18.2.0", - "schema-sdk": "^0.11.3" + "schema-sdk": "^0.12.0" }, "peerDependencies": { "@tanstack/react-query": "5.79.2", diff --git a/packages/react/scripts/codegen.ts b/packages/react/scripts/codegen.ts index 09bc231..c355d66 100644 --- a/packages/react/scripts/codegen.ts +++ b/packages/react/scripts/codegen.ts @@ -13,6 +13,24 @@ const options = getDefaultSchemaSDKOptions({ 'io.k8s.api.events.v1.Event', 'io.k8s.api.flowcontrol*', ], + jsonpatch: [ + { + op: 'remove', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/type' + }, + { + op: 'remove', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/format' + }, + { + op: 'add', + path: '/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString/oneOf', + value: [ + { type: 'string' }, + { type: 'integer', format: 'int32' } + ] + } + ] }); const openApiOptions = { ...options, diff --git a/yarn.lock b/yarn.lock index fbcf5e0..d1be38b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2761,6 +2761,11 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.8" +fast-json-patch@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947" + integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ== + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0: version "2.1.0" 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: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -schema-sdk@^0.11.3: - version "0.11.3" - resolved "https://registry.yarnpkg.com/schema-sdk/-/schema-sdk-0.11.3.tgz#cea5d1bf747e04824a8a848af8d2c51990b16b2f" - integrity sha512-clsw2kq2jkXAEhVw7qc1vV1xVBNUSbDc9OqhxU69XlKtiZaOfjz1viPB1FAFW4vFBM98YTzKNDDPA/jEh5Rr8A== +schema-sdk@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/schema-sdk/-/schema-sdk-0.12.0.tgz#3d57e5b8642636011ab2c16479a3b019849a9cab" + integrity sha512-Za2kaXpanSioGqkK4cRe/epndQkJc6a037EcJ6ZrvhoFs6N9IW9IRT/IVEv7J0bpyR4WGloB2yk4w+/eSUkMdg== dependencies: "@babel/generator" "^7.24.4" "@babel/types" "^7.24.0" "@interweb-utils/casing" "^0.2.0" "@interweb/fetch-api-client" "^0.6.1" deepmerge "^4.3.1" + fast-json-patch "^3.1.1" schema-typescript "^0.12.1" schema-typescript@^0.12.1: