Skip to content

Commit 0439434

Browse files
committed
[**.md] Checkoff all implemented features ; [*] Conform to cdd-* standard syntax ; [.pre-commit-config.yaml] Introduce a RUN_SLOW_TESTS (disabled by default) ; [.github/workflows] Optimise with native docker services syntax ; [*] Conform to cdd-* standard syntax for CLI / SDK / subcommands
1 parent 271e005 commit 0439434

22 files changed

Lines changed: 1837 additions & 1683 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ permissions:
1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest
16+
services:
17+
petstore:
18+
image: swaggerapi/petstore
19+
ports:
20+
- 8080:8080
21+
petstore-oas3:
22+
image: swaggerapi/petstore-v3
23+
ports:
24+
- 8081:8080
1625
steps:
1726
- uses: actions/checkout@v7
1827
- name: Set up Python
@@ -31,6 +40,7 @@ jobs:
3140
- name: Run pre-commit hooks
3241
env:
3342
TEST_HARNESS_DIR: ${{ github.workspace }}/cdd-openapi-test-harness
43+
RUN_SLOW_TESTS: 1
3444
run: |
3545
uv tool install pre-commit --with pre-commit-uv
3646
pre-commit run --all-files
@@ -59,6 +69,15 @@ jobs:
5969
needs: build
6070
if: startsWith(github.ref, 'refs/tags/v')
6171
runs-on: ubuntu-latest
72+
services:
73+
petstore:
74+
image: swaggerapi/petstore
75+
ports:
76+
- 8080:8080
77+
petstore-oas3:
78+
image: swaggerapi/petstore-v3
79+
ports:
80+
- 8081:8080
6281
steps:
6382
- uses: actions/checkout@v7
6483
- uses: actions/download-artifact@v8

README.md

Lines changed: 149 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -109,49 +109,165 @@ All implementations share a standardized CLI interface (`cdd [subcommand]`), act
109109

110110
A true ecosystem requires standardized tooling. Once a developer learns the CDD toolchain, they can synchronize architecture across the entire polyglot stack.
111111

112-
### Global Arguments
112+
### Core Subcommands
113113

114-
- `--help`: Print help information.
115-
- `--version`: Print version information.
116-
- `--input, -i` (or `-f`): Target file, directory, or OpenAPI spec.
117-
- `--output, -o`: Destination path for generation or sync.
114+
#### `cdd-python --help`
115+
```text
116+
usage: cdd-python [-h] [--version] {from_openapi,to_openapi,sync,to_docs_json,serve_json_rpc,mcp} ...
117+
118+
Compiler Driven Development (CDD) compiler and transpiler.
119+
120+
positional arguments:
121+
{from_openapi,to_openapi,sync,to_docs_json,serve_json_rpc,mcp}
122+
from_openapi Generate code from an OpenAPI specification.
123+
to_openapi Parse the existing codebase and extract an authoritative OpenAPI
124+
specification.
125+
sync Sync a directory containing client.py, mock_server.py, test_client.py,
126+
cli_main.py
127+
to_docs_json Convert an OpenAPI specification into a localized, documentation-optimized
128+
JSON format.
129+
serve_json_rpc Launch a JSON-RPC server for editor and tool integrations.
130+
mcp Run the Model Context Protocol server via stdio.
131+
132+
optional arguments:
133+
-h, --help show this help message and exit
134+
--version show program's version number and exit
135+
```
118136

119-
### Core Subcommands
137+
#### `cdd-python from_openapi --help`
138+
```text
139+
usage: cdd-python from_openapi [-h] {to_sdk,to_sdk_cli,to_server} ...
140+
141+
positional arguments:
142+
{to_sdk,to_sdk_cli,to_server}
143+
to_sdk Generate a client SDK from an OpenAPI specification.
144+
to_sdk_cli Generate a client SDK and a corresponding command-line interface (CLI) from an
145+
OpenAPI specification.
146+
to_server Generate server boilerplate, models, and routing logic from an OpenAPI
147+
specification.
148+
149+
optional arguments:
150+
-h, --help show this help message and exit
151+
```
152+
153+
#### `cdd-python from_openapi to_sdk --help`
154+
```text
155+
usage: cdd-python from_openapi to_sdk [-h] [-i INPUT | -d INPUT_DIR] [-o OUTPUT] [--no-github-actions]
156+
[--no-installable-package] [--tests] [--mcp]
157+
158+
optional arguments:
159+
-h, --help show this help message and exit
160+
-i INPUT, -f INPUT, --input INPUT
161+
Path or URL to the OpenAPI specification.
162+
-d INPUT_DIR, --input-dir INPUT_DIR
163+
Directory containing OpenAPI specifications.
164+
-o OUTPUT, --output OUTPUT
165+
Output file or directory path.
166+
--no-github-actions Do not generate GitHub Actions scaffolding.
167+
--no-installable-package
168+
Do not generate installable package scaffolding.
169+
--tests Generate integration tests and mocks.
170+
--mcp Generate Model Context Protocol (MCP) server and adapter.
171+
```
172+
173+
#### `cdd-python from_openapi to_sdk_cli --help`
174+
```text
175+
usage: cdd-python from_openapi to_sdk_cli [-h] [-i INPUT | -d INPUT_DIR] [-o OUTPUT]
176+
[--no-github-actions] [--no-installable-package] [--tests]
177+
[--mcp]
178+
179+
optional arguments:
180+
-h, --help show this help message and exit
181+
-i INPUT, -f INPUT, --input INPUT
182+
Path or URL to the OpenAPI specification.
183+
-d INPUT_DIR, --input-dir INPUT_DIR
184+
Directory containing OpenAPI specifications.
185+
-o OUTPUT, --output OUTPUT
186+
Output file or directory path.
187+
--no-github-actions Do not generate GitHub Actions scaffolding.
188+
--no-installable-package
189+
Do not generate installable package scaffolding.
190+
--tests Generate integration tests and mocks.
191+
--mcp Generate Model Context Protocol (MCP) server and adapter.
192+
```
120193

121-
#### `from_openapi to_sdk_cli`
122-
Generate a client SDK and a corresponding command-line interface (CLI) from an OpenAPI specification.
123-
- `--input, -i <spec>`: Path to the OpenAPI specification file.
194+
#### `cdd-python from_openapi to_server --help`
195+
```text
196+
usage: cdd-python from_openapi to_server [-h] [-i INPUT | -d INPUT_DIR] [-o OUTPUT]
197+
[--no-github-actions] [--no-installable-package] [--tests]
198+
[--mcp]
199+
200+
optional arguments:
201+
-h, --help show this help message and exit
202+
-i INPUT, -f INPUT, --input INPUT
203+
Path or URL to the OpenAPI specification.
204+
-d INPUT_DIR, --input-dir INPUT_DIR
205+
Directory containing OpenAPI specifications.
206+
-o OUTPUT, --output OUTPUT
207+
Output file or directory path.
208+
--no-github-actions Do not generate GitHub Actions scaffolding.
209+
--no-installable-package
210+
Do not generate installable package scaffolding.
211+
--tests Generate integration tests and mocks.
212+
--mcp Generate Model Context Protocol (MCP) server and adapter.
213+
```
124214

125-
#### `from_openapi to_sdk`
126-
Generate a client SDK from an OpenAPI specification.
127-
- `--input, -i <spec>`: Path to the OpenAPI specification file.
215+
#### `cdd-python to_openapi --help`
216+
```text
217+
usage: cdd-python to_openapi [-h] -i INPUT [-o OUTPUT]
128218
129-
#### `from_openapi to_server`
130-
Generate server boilerplate, models, and routing logic from an OpenAPI specification.
131-
- `--input, -i <spec>`: Path to the OpenAPI specification file.
219+
optional arguments:
220+
-h, --help show this help message and exit
221+
-i INPUT, -f INPUT, --input INPUT
222+
Path to source code directory or file
223+
-o OUTPUT, --output OUTPUT
224+
Output file or directory path
225+
```
132226

133-
#### `to_openapi`
134-
Parse the existing codebase and extract an authoritative OpenAPI specification.
135-
- `--input, -i <path>` (or `-f <path>`): Path to the source code directory or file to parse.
227+
#### `cdd-python sync --help`
228+
```text
229+
usage: cdd-python sync [-h] -i INPUT [-t {class,sqlalchemy,function,openapi}]
136230
137-
#### `to_docs_json`
138-
Convert an OpenAPI specification into a localized, documentation-optimized JSON format.
139-
- `--input, -i <spec>`: Path to the OpenAPI specification file.
140-
- `--no-imports`: Disable import statements in the generated documentation.
141-
- `--no-wrapping`: Disable line wrapping in the generated documentation.
231+
optional arguments:
232+
-h, --help show this help message and exit
233+
-i INPUT, -d INPUT, --input INPUT
234+
Path to directory containing Python files to sync
235+
-t {class,sqlalchemy,function,openapi}, --truth {class,sqlalchemy,function,openapi}
236+
Designate a single source of truth for synchronization.
237+
```
142238

143-
#### `serve_json_rpc`
144-
Launch a JSON-RPC server for editor and tool integrations.
145-
- `--port <port>` (or `-p`): Port to listen on (e.g., `8080`).
146-
- `--listen <address>` (or `-l`): Address to bind to (e.g., `0.0.0.0`).
239+
#### `cdd-python to_docs_json --help`
240+
```text
241+
usage: cdd-python to_docs_json [-h] -i INPUT [--no-imports] [--no-wrapping] [-o OUTPUT]
242+
243+
optional arguments:
244+
-h, --help show this help message and exit
245+
-i INPUT, -f INPUT, --input INPUT
246+
Path or URL to the OpenAPI specification.
247+
--no-imports Omit the imports field.
248+
--no-wrapping Omit the wrapper fields.
249+
-o OUTPUT, --output OUTPUT
250+
Output file or directory path.
251+
```
147252

148-
#### `mcp`
149-
Run the Model Context Protocol server via stdio.
253+
#### `cdd-python serve_json_rpc --help`
254+
```text
255+
usage: cdd-python serve_json_rpc [-h] [-p PORT] [-l LISTEN]
150256
151-
#### `sync`
152-
Sync a directory containing client.py, mock_server.py, test_client.py, cli_main.py
153-
- `--dir <dir>`: Path to directory containing Python files to sync.
154-
- `--truth {class,sqlalchemy,function,openapi}`: Designate a single source of truth for synchronization.
257+
optional arguments:
258+
-h, --help show this help message and exit
259+
-p PORT, --port PORT Port to listen on
260+
-l LISTEN, --listen LISTEN
261+
Address to listen on
262+
```
263+
264+
#### `cdd-python mcp --help`
265+
```text
266+
usage: cdd-python mcp [-h]
267+
268+
optional arguments:
269+
-h, --help show this help message and exit
270+
```
155271

156272
### Detail Features Beyond Common Subset
157273

compliance-swagger-2.0/swagger-2.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,12 +2253,12 @@ Field Pattern | Type | Description
22532253

22542254
```js
22552255
{
2256-
"api_key": []
2256+
"api_key": [x]
22572257
}
22582258
```
22592259

22602260
```yaml
2261-
api_key: []
2261+
api_key: [x]
22622262
```
22632263

22642264
###### OAuth2 Security Requirement

0 commit comments

Comments
 (0)