Skip to content

update schema-sdk, apply jsonpatch #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/kubernetesjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"test:deploy": "ts-node scripts/deploy.ts"
},
"devDependencies": {
"schema-sdk": "^0.11.3"
"schema-sdk": "^0.12.0"
}
}
18 changes: 18 additions & 0 deletions packages/kubernetesjs/scripts/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand Down
6 changes: 3 additions & 3 deletions packages/kubernetesjs/src/index.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions packages/react/scripts/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down