Closed rotty3000 closed 4 months ago
I have a CRD with:
apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: ... spec: ... versions: - name: v1alpha1 served: true storage: true schema: openAPIV3Schema: type: object properties: apiVersion: type: string kind: type: string metadata: type: object spec: ... required: - apiVersion - kind - metadata - spec
After running:
npx crdtoapi -i ./crds/ -o ./openapi.yaml npx crdtotypes -i ./openapi.yaml -o ./src/crd/
I get a type having:
... /** metadata * * @required {false} * @originalType {FooMetadata} */ metadata?: IoK8sApimachineryPkgApisMetaV1ObjectMeta; /** spec * * @required {false} */ spec?: FooSpec
PR forthcoming.
Nice
very nice tool @yaacov ! It's going to save me lots of pain and suffering 😅
https://www.npmjs.com/package/crdtoapi/v/0.0.16 - :tada:
I have a CRD with:
After running:
I get a type having:
PR forthcoming.