You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 2. Unzip the package and add the binary location to PATH
50
+
export PATH="<Your directory to store KCLOpenapi binary>:$PATH"
51
+
```
52
+
34
53
## Features
35
54
36
55
The tool translates Swagger OpenAPI spec and Kubernetes CRD to KCL models.
@@ -42,13 +61,12 @@ tool will extract the defined models from it and generate the corresponding KCL
42
61
43
62
The command is as follows:
44
63
64
+
```shell
65
+
kcl-openapi generate model -f ${your_open_api_spec} -t ${the_kcl_files_output_dir}
66
+
```
45
67
46
-
```shell
47
-
kcl-openapi generate model -f ${your_open_api_spec} -t ${the_kcl_files_output_dir}
48
-
```
49
-
50
-
> **Note**: The Kubernetes API models among all versions are pre-generated, you can directly use it. Please refer the [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start) for how to pull and use the package.
51
-
Alternatively, if you need to generate them yourself, please refer [Generate KCL Packages from Kubernetes OpenAPI Specs](./docs/generate_from_k8s_spec.md).
68
+
> **Note**: The [Kubernetes KCL models](https://github.com/orgs/KusionStack/packages/container/package/k8s) among all versions are pre-generated, you get it by executing `kpm add k8s:<version>` under your project. For detailed information about kpm usage, please refer to [kpm quick start guide](https://github.com/kcl-lang/kpm#quick-start).
69
+
Alternatively, if you may want to generate them yourself, please refer [Generate KCL Packages from Kubernetes OpenAPI Specs](./docs/generate_from_k8s_spec.md).
52
70
53
71
### Translate Kubernetes CRD to KCL
54
72
@@ -59,9 +77,9 @@ OpenAPI tool will extract the structural schema and generate the corresponding K
59
77
60
78
The command is as follows:
61
79
62
-
```shell
63
-
kcl-openapi generate model --crd -f ${your_CRD.yaml} -t ${the_kcl_files_output_dir} --skip-validation
64
-
```
80
+
```shell
81
+
kcl-openapi generate model --crd -f ${your_CRD.yaml} -t ${the_kcl_files_output_dir} --skip-validation
0 commit comments