CustomResourceDefinitions to OpensAPI
crdtoapi is a tool that creates an OpenAPI definitions file from kubernetes CustomResourceDefinitions.
Usage
Use kubernetes CRD definitions to create OpenAPI schema file.
npm install --location=global crdtoapi
crdtoapi --help
crdtoapi -i ./examples/forklift/
crdtoapi -i ./examples/forklift/ -o openapi.yaml \
--title "Forklift API" \
--description "Migration toolkit for virtualization (Forklift) API definitions." \
--license "Apache-2.0" \
--apiVersion "2.4.0" \
--contactEmail "kubev2v-dev@redhat.com"
Generate some API
OpensAPI comunity provide many tools, for example
openapi-generator-cli
is a tool for auto code generation using OpenAPI definition files.
openapi-generator-cli generate \
-g typescript-fetch \
--skip-validate-spec \
-o generated \
-i openapi.yaml
Build
Run this scripts to lint and publish the package.
npm install
npm run lint:fix
npm run build
npm publish