Skip to content

soft-stech/kubernetes-zod-models-ts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-models-ts

Test

Kubernetes models in TypeScript.

Installation

Install with npm.

npm install kubernetes-models

Usage

import { Pod } from "kubernetes-models/v1";

// Create a new instance
const pod = new Pod({
  metadata: {
    name: "foo"
  },
  spec: {
    containers: []
  }
});

// Validate against JSON schema
pod.validate();

See examples folder for more examples.

Usage with zod

import { iPodSchema } from "kubernetes-models/v1/Pod.schema";

const pod: unknown = {
  apiVersion: "v1",
  kind: "Pod",
  spec: {
    containers: []
  }
};

// Validate against zod schema
iPodSchema.parse(pod);

Packages

Models

3rd-party Models

Generators

Runtime Dependencies

Utilities

License

MIT

Packages

No packages published

Languages

  • TypeScript 98.8%
  • Other 1.2%