Skip to content

Commit bf43088

Browse files
committed
Consolidated to bin/gen
1 parent ceb918b commit bf43088

File tree

4 files changed

+195
-230
lines changed

4 files changed

+195
-230
lines changed

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,23 @@ check-deps: ## Check if all dependencies are installed
8888

8989
prepare: check-deps ## Prepare the OpenAPI specification
9090
@echo "Preparing OpenAPI specification..."
91-
./bin/capi-openapi prepare
91+
./bin/gen prepare --version=$(CAPI_VERSION)
9292

9393
gen-openapi-spec: check-deps ## Merge the CAPI OpenAPI specifications
9494
@echo "Merging CAPI OpenAPI specifications..."
95-
./bin/capi-openapi gen openapi spec
95+
./bin/gen merge --version=$(CAPI_VERSION)
9696

97-
gen-go-client: check-deps gen-openapi-spec ## Generate Go client from OpenAPI spec
97+
gen-go-client: gen-openapi-spec ## Generate Go client from OpenAPI spec
9898
@echo "Generating Go client..."
99-
./bin/capi-openapi gen go client
99+
./bin/gen --version=$(CAPI_VERSION) --language=go
100100

101101
all: deps prepare gen-openapi-spec gen-go-client ## Run all steps to generate the Go client
102+
103+
gen-sdk: ## Generate SDK for specified language (usage: make gen-sdk LANGUAGE=go VERSION=3.195.0)
104+
@if [ -z "$(LANGUAGE)" ]; then \
105+
echo "Error: LANGUAGE is required. Usage: make gen-sdk LANGUAGE=go VERSION=3.195.0"; \
106+
exit 1; \
107+
fi
108+
@VERSION=$${VERSION:-$(CAPI_VERSION)}; \
109+
echo "Generating $$LANGUAGE SDK for version $$VERSION..."; \
110+
./bin/gen --version=$$VERSION --language=$(LANGUAGE)

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,22 @@ This repository contains a comprehensive OpenAPI specification that fully descri
3737
cd capi-openapi-spec
3838
```
3939

40-
2. **Generate the unified OpenAPI specification**
40+
2. **Install dependencies**
41+
```bash
42+
make deps
43+
```
44+
45+
3. **Generate the unified OpenAPI specification**
4146
```bash
4247
make gen-openapi-spec
4348
```
4449
This creates `capi/3.195.0.openapi.yaml` and `capi/3.195.0.openapi.json`
4550

46-
3. **Generate a client SDK** (example for Go)
51+
4. **Generate a client SDK** (example for Go)
4752
```bash
4853
make gen-go-client
54+
# Or for any language:
55+
make gen-sdk LANGUAGE=python VERSION=3.195.0
4956
```
5057

5158
## SDK Generation
@@ -54,7 +61,14 @@ The `bin/gen` script provides a flexible way to generate SDKs for different lang
5461

5562
### Usage
5663
```bash
64+
# Generate SDK
5765
./bin/gen --version=VERSION --language=LANGUAGE [--output=PATH]
66+
67+
# Prepare specifications (download and create YAML files)
68+
./bin/gen prepare --version=VERSION
69+
70+
# Merge YAML files into unified OpenAPI spec
71+
./bin/gen merge --version=VERSION
5872
```
5973

6074
### Examples
@@ -178,8 +192,8 @@ capi/
178192
├── 3.195.0.openapi.yaml (generated)
179193
└── 3.195.0.openapi.json (generated)
180194
bin/
181-
├── capi-openapi (main processing script)
182-
└── gen (SDK generation script)
195+
├── gen (main processing script for prepare, merge, and SDK generation)
196+
└── validate (OpenAPI spec validation script)
183197
sdk/
184198
└── VERSION/
185199
└── LANGUAGE/ (generated SDKs)

bin/capi-openapi

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

0 commit comments

Comments
 (0)