@travetto/openapi 3.0.0-rc.1 → 3.0.0-rc.3

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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/src/service.ts +9 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
3
  "displayName": "OpenAPI Specification",
4
- "version": "3.0.0-rc.1",
4
+ "version": "3.0.0-rc.3",
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": "^3.0.0-rc.1",
32
- "@travetto/rest": "^3.0.0-rc.1",
33
- "@travetto/schema": "^3.0.0-rc.1",
34
- "@travetto/yaml": "^3.0.0-rc.0",
31
+ "@travetto/config": "^3.0.0-rc.3",
32
+ "@travetto/rest": "^3.0.0-rc.3",
33
+ "@travetto/schema": "^3.0.0-rc.3",
34
+ "@travetto/yaml": "^3.0.0-rc.1",
35
35
  "openapi3-ts": "^2.0.2"
36
36
  },
37
37
  "peerDependencies": {
38
- "@travetto/cli": "^3.0.0-rc.0"
38
+ "@travetto/cli": "^3.0.0-rc.1"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@travetto/cli": {
package/src/service.ts CHANGED
@@ -71,12 +71,16 @@ export class OpenApiService {
71
71
  * Persist to local file
72
72
  */
73
73
  async persist(): Promise<void> {
74
- console.debug('Generating OpenAPI Spec', { output: this.apiSpecConfig.output });
74
+ try {
75
+ console.debug('Generating OpenAPI Spec', { output: this.apiSpecConfig.output });
75
76
 
76
- const output = this.apiSpecConfig.output.endsWith('.json') ?
77
- JSON.stringify(this.spec, undefined, 2) :
78
- YamlUtil.serialize(this.spec);
77
+ const output = this.apiSpecConfig.output.endsWith('.json') ?
78
+ JSON.stringify(this.spec, undefined, 2) :
79
+ YamlUtil.serialize(this.spec);
79
80
 
80
- await fs.writeFile(this.apiSpecConfig.output, output);
81
+ await fs.writeFile(this.apiSpecConfig.output, output);
82
+ } catch (err) {
83
+ console.error('Unable to persist openapi spec', err);
84
+ }
81
85
  }
82
86
  }