@travetto/openapi 2.0.3 → 2.1.0

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
@@ -67,7 +67,7 @@ export class ApiSpecConfig {
67
67
  /**
68
68
  * Should file be generated at runtime
69
69
  */
70
- persist: boolean = !EnvUtil.isReadonly();
70
+ persist: boolean = EnvUtil.isDynamic();
71
71
  /**
72
72
  * Skip emitting all routes
73
73
  */
@@ -122,7 +122,7 @@ The module provides a plugin for the [Command Line Interface](https://github.com
122
122
  ```bash
123
123
  $ trv openapi:client --help
124
124
 
125
- Usage: openapi:client [options] [forma]
125
+ Usage: openapi:client [options] [format-or-preset]
126
126
 
127
127
  Options:
128
128
  -x, --extended-help Show Extended Help
@@ -135,10 +135,10 @@ Options:
135
135
 
136
136
  Available Presets
137
137
  ----------------------------------
138
- * @trv/angular10 -- typescript-angular supportsES6=true,ngVersion=10.0
139
- * @trv/angular11 -- typescript-angular supportsES6=true,ngVersion=11.0
140
- * @trv/angular12 -- typescript-angular supportsES6=true,ngVersion=11.0
141
- * @trv/fetch -- typescript-fetch
138
+ * @trv:angular10 -- typescript-angular supportsES6=true,ngVersion=10.0
139
+ * @trv:angular11 -- typescript-angular supportsES6=true,ngVersion=11.0
140
+ * @trv:angular12 -- typescript-angular supportsES6=true,ngVersion=11.0
141
+ * @trv:fetch -- typescript-fetch
142
142
  ```
143
143
 
144
144
  This tool relies upon a custom build of [OpenAPI client generation tools](https://github.com/OpenAPITools/openapi-generator), which supports watching. This allows for fast responsive client generation as the shape of the API changes.
@@ -49,7 +49,7 @@ export class OpenApiClientPlugin extends BasePlugin {
49
49
  const presetEntries = Object
50
50
  .entries(presets)
51
51
  .sort(([a], [b]) => a.localeCompare(b))
52
- .map(([k, [cmd, v]]) => [`@trv/${k}`.padEnd(presetLen + 5), [cmd, this.presetMap(v)]] as const);
52
+ .map(([k, [cmd, v]]) => [`@trv:${k}`.padEnd(presetLen + 5), [cmd, this.presetMap(v)]] as const);
53
53
 
54
54
  const presetText = color`
55
55
  ${{ subtitle: 'Available Presets' }}
@@ -65,7 +65,7 @@ ${this.getListOfFormats().map(x => color`* ${{ input: x }}`).join('\n')} `;
65
65
  }
66
66
 
67
67
  getArgs() {
68
- return '[format or preset]';
68
+ return '[format-or-preset]';
69
69
  }
70
70
 
71
71
  async action(format: string) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
3
  "displayName": "OpenAPI Specification",
4
- "version": "2.0.3",
4
+ "version": "2.1.0",
5
5
  "description": "OpenAPI integration support for the travetto framework",
6
6
  "keywords": [
7
7
  "rest",
@@ -28,14 +28,14 @@
28
28
  "directory": "module/openapi"
29
29
  },
30
30
  "dependencies": {
31
- "@travetto/config": "^2.0.2",
32
- "@travetto/rest": "^2.0.2",
33
- "@travetto/schema": "^2.0.3",
34
- "@travetto/yaml": "^2.0.2",
31
+ "@travetto/config": "^2.1.0",
32
+ "@travetto/rest": "^2.1.0",
33
+ "@travetto/schema": "^2.1.0",
34
+ "@travetto/yaml": "^2.1.0",
35
35
  "openapi3-ts": "^2.0.1"
36
36
  },
37
37
  "optionalPeerDependencies": {
38
- "@travetto/cli": "^2.0.2"
38
+ "@travetto/cli": "^2.1.0"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -205,6 +205,9 @@ export class SpecGenerator {
205
205
  const required: string[] = [];
206
206
 
207
207
  for (const fieldName of def.fields) {
208
+ if (SchemaRegistry.has(def.schema[fieldName].type)) {
209
+ this.#processSchema(def.schema[fieldName].type);
210
+ }
208
211
  properties[fieldName] = this.#processSchemaField(def.schema[fieldName], required);
209
212
  }
210
213