Skip to content

Commit badcd96

Browse files
committed
chore: deprecated kcl-openapi tool and just used as a normal go package
Signed-off-by: Peefy <[email protected]>
1 parent 5ce8e2b commit badcd96

File tree

3 files changed

+6
-195
lines changed

3 files changed

+6
-195
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.goreleaser.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,79 +17,28 @@ Main use cases:
1717
+ Kubernetes CRD
1818
+ Translate Kubernetes CRD to KCL code
1919

20-
## Quick Start
21-
22-
### Install
23-
24-
The kcl-openapi tool can be installed in both ways:
25-
26-
- [go install](#1-go-install)
27-
- [curl|sh install (MacOS & Linux)](#2-curlsh-install-macos--linux)
28-
- [download from release](#3-download-from-release)
29-
30-
## 1 go install
31-
32-
```shell
33-
go install kcl-lang.io/kcl-openapi@latest
34-
```
35-
36-
## 2 Curl|sh install (MacOS & Linux)
37-
38-
If you don't have to go, you can install the CLI with this one-liner:
39-
40-
```shell
41-
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
42-
```
43-
44-
## 3 Download from release
45-
46-
```shell
47-
# 1. download the released binary from:
48-
# https://github.com/kcl-lang/kcl-openapi/releases
49-
50-
# 2. Unzip the package and add the binary location to PATH
51-
export PATH="<Your directory to store KCLOpenAPI binary>:$PATH"
52-
```
53-
5420
## Features
5521

56-
The tool translates Swagger OpenAPI spec and Kubernetes CRD to KCL models.
22+
The package translates Swagger OpenAPI spec and Kubernetes CRD to KCL models.
5723

5824
### Translate Swagger OpenAPI Spec to KCL
5925

60-
The tool now supports [OpenAPI 2.0](https://swagger.io/specification/v2/). By parsing the "Definitions" section of the spec, the KCL OpenAPI
61-
tool will extract the defined models from it and generate the corresponding KCL representation.
62-
63-
The command is as follows:
64-
65-
```shell
66-
kcl-openapi generate model -f ${your_open_api_spec} -t ${the_kcl_files_output_dir}
67-
```
26+
The package now supports [OpenAPI 2.0](https://swagger.io/specification/v2/). By parsing the "Definitions" section of the spec, the KCL OpenAPI
27+
package will extract the defined models from it and generate the corresponding KCL representation.
6828

69-
> **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).
70-
Alternatively, if you may want to generate them yourself, please refer [Generate KCL Packages from Kubernetes OpenAPI Specs](./docs/generate_from_k8s_spec.md).
29+
> **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 `kcl mod add k8s:<version>` under your project. Alternatively, if you may want to generate them yourself, please refer [Generate KCL Packages from Kubernetes OpenAPI Specs](./docs/generate_from_k8s_spec.md).
7130
7231
### Translate Kubernetes CRD to KCL
7332

74-
The tool can also translate
33+
The package can also translate
7534
the [Kubernetes CRD](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) to KCL models.
7635
By parsing the `spec.versions[n].schema.openAPIV3Schema` (n means the latest version of the spec will be used) section of the CRD, the KCL
77-
OpenAPI tool will extract the structural schema and generate the corresponding KCL representation.
78-
79-
The command is as follows:
80-
81-
```shell
82-
kcl-openapi generate model --crd -f ${your_CRD.yaml} -t ${the_kcl_files_output_dir} --skip-validation
83-
```
36+
OpenAPI package will extract the structural schema and generate the corresponding KCL representation.
8437

8538
## KCL OpenAPI Spec
8639

8740
The [KCL OpenAPI Spec](https://www.kcl-lang.io/docs/tools/cli/openapi/openapi-to-kcl) defines a complete specification of how OpenAPI objects are mapped to KCL language elements.
8841

89-
## Ask for help
90-
91-
If the tool isn't working as you expect, please reach out to us by filing an [issue](https://github.com/kcl-lang/kcl-openapi/issues).
92-
9342
## License
9443

9544
Apache License Version 2.0

0 commit comments

Comments
 (0)