@travetto/openapi 8.0.0-alpha.16 → 8.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -117,39 +117,47 @@ export class ApiSpecConfig {
117
117
  The framework, when in watch mode, will generate the [OpenAPI](https://github.com/OAI/OpenAPI-Specification) specification in either [JSON](https://www.json.org) or [YAML](https://en.wikipedia.org/wiki/YAML). This module integrates with the file watching paradigm and can regenerate the openapi spec as changes to endpoints and models are made during development. The output format is defined by the suffix of the output file, `.yaml` or `.json`.
118
118
 
119
119
  ## CLI - openapi:spec
120
- The module provides a command for the [Command Line Interface](https://github.com/travetto/travetto/tree/main/module/cli#readme "CLI infrastructure for Travetto framework") to allow scripting file generation.
120
+ The command will load your application, in non-listening mode, to collect all the endpoints and model information, to produce the `openapi.yml`. Once produced, the code will store the output in the specified location.
121
121
 
122
- **Terminal: OpenAPI usage**
122
+ **Terminal: Help for openapi:spec**
123
123
  ```bash
124
124
  $ trv openapi:spec --help
125
125
 
126
126
  Usage: openapi:spec [options]
127
127
 
128
+ Generate the OpenAPI specification for the selected module.
129
+
130
+ The resulting JSON can be written to stdout or to a file path for use in
131
+ downstream tooling, CI publishing, and client generation pipelines.
132
+
128
133
  Options:
129
134
  -o, --output <string> Output files
130
135
  -m, --module <module> Module to run for
131
136
  --help display help for command
132
137
  ```
133
138
 
134
- The command will run your application, in non-server mode, to collect all the endpoints and model information, to produce the `openapi.yml`. Once produced, the code will store the output in the specified location.
135
-
136
139
  **Note**: The module supports generating the OpenAPI spec in real-time while listening for changes to endpoints and models.
137
140
 
138
141
  ## CLI - openapi:client
139
- The module provides a command for the [Command Line Interface](https://github.com/travetto/travetto/tree/main/module/cli#readme "CLI infrastructure for Travetto framework") to allow client generation from the API structure.
142
+ Generate API clients from an OpenAPI specification using the generator image.
140
143
 
141
- **Terminal: OpenAPI usage**
144
+ **Terminal: Help for openapi:client**
142
145
  ```bash
143
146
  $ trv openapi:client --help
144
147
 
145
148
  Usage: openapi:client [options] <format:string>
146
149
 
150
+ Generate API clients from an OpenAPI specification using the generator image.
151
+
152
+ This command wraps OpenAPI Generator in Docker and writes generated client code
153
+ into the configured output folder.
154
+
147
155
  Options:
148
- -x, --extended-help Show Extended Help (default: false)
149
- -a, --additional-properties <string> Additional Properties (default: [])
150
- -i, --input <string> Input file (default: "./openapi.yml")
151
- -o, --output <string> Output folder (default: "./api-client")
152
- -d, --docker-image <string> Docker Image to user (default: "openapitools/openapi-generator-cli:latest")
156
+ -x, --extended-help Show expanded generator help for all available formats/options. (default: false)
157
+ -a, --additional-properties <string> Additional generator properties passed as comma-separated key/value pairs. (default: [])
158
+ -i, --input <string> Input OpenAPI document path. (default: "./openapi.yml")
159
+ -o, --output <string> Output directory for generated client sources. (default: "./api-client")
160
+ -d, --docker-image <string> Docker image used to run OpenAPI Generator. (default: "openapitools/openapi-generator-cli:latest")
153
161
  --help display help for command
154
162
  ```
155
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
- "version": "8.0.0-alpha.16",
3
+ "version": "8.0.0-alpha.18",
4
4
  "type": "module",
5
5
  "description": "OpenAPI integration support for the Travetto framework",
6
6
  "keywords": [
@@ -27,14 +27,14 @@
27
27
  "directory": "module/openapi"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/config": "^8.0.0-alpha.15",
31
- "@travetto/schema": "^8.0.0-alpha.15",
32
- "@travetto/web": "^8.0.0-alpha.16",
33
- "openapi3-ts": "^4.5.0",
34
- "yaml": "^2.8.3"
30
+ "@travetto/config": "^8.0.0-alpha.17",
31
+ "@travetto/schema": "^8.0.0-alpha.17",
32
+ "@travetto/web": "^8.0.0-alpha.18",
33
+ "openapi3-ts": "^4.6.0",
34
+ "yaml": "^2.9.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@travetto/cli": "^8.0.0-alpha.20"
37
+ "@travetto/cli": "^8.0.0-alpha.22"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@travetto/cli": {
@@ -7,21 +7,24 @@ import { ExecUtil } from '@travetto/runtime';
7
7
  import { OpenApiClientHelp } from './bin/help.ts';
8
8
 
9
9
  /**
10
- * CLI for generating the cli client
10
+ * Generate API clients from an OpenAPI specification using the generator image.
11
+ *
12
+ * This command wraps OpenAPI Generator in Docker and writes generated client code
13
+ * into the configured output folder.
11
14
  */
12
15
  @CliCommand()
13
16
  export class OpenApiClientCommand implements CliCommandShape {
14
- /** Show Extended Help */
17
+ /** Show expanded generator help for all available formats/options. */
15
18
  @CliFlag({ short: '-x' })
16
19
  extendedHelp: boolean = false;
17
- /** Additional Properties */
20
+ /** Additional generator properties passed as comma-separated key/value pairs. */
18
21
  @CliFlag({ short: '-a', full: '--additional-properties' })
19
22
  properties: string[] = [];
20
- /** Input file */
23
+ /** Input OpenAPI document path. */
21
24
  input = './openapi.yml';
22
- /** Output folder */
25
+ /** Output directory for generated client sources. */
23
26
  output = './api-client';
24
- /** Docker Image to user */
27
+ /** Docker image used to run OpenAPI Generator. */
25
28
  dockerImage = 'openapitools/openapi-generator-cli:latest';
26
29
 
27
30
  async help(): Promise<string[]> {
@@ -7,7 +7,10 @@ import { Registry } from '@travetto/registry';
7
7
  import { DependencyRegistryIndex } from '@travetto/di';
8
8
 
9
9
  /**
10
- * CLI for outputting the open api spec to a local file
10
+ * Generate the OpenAPI specification for the selected module.
11
+ *
12
+ * The resulting JSON can be written to stdout or to a file path for use in
13
+ * downstream tooling, CI publishing, and client generation pipelines.
11
14
  */
12
15
  @CliCommand()
13
16
  export class OpenApiSpecCommand implements CliCommandShape {