openapi3-ts
Advanced tools
Comparing version 3.1.0 to 3.1.1
# Changelog: openapi3-ts | ||
## Version 3.1.1 | ||
2022.10.10 | ||
- PR [#89](https://github.com/metadevpro/openapi3-ts/pull/89) Make Webhooks optional (not supportet in OPenAPI 3.0). Contributed by @samchungy | ||
## Version 3.1.0 | ||
@@ -5,0 +11,0 @@ |
@@ -26,4 +26,3 @@ "use strict"; | ||
tags: [], | ||
servers: [], | ||
webhooks: {} | ||
servers: [] | ||
}; | ||
@@ -142,2 +141,5 @@ } | ||
addWebhook(webhook, webhookItem) { | ||
var _a; | ||
var _b; | ||
(_a = (_b = this.rootDoc).webhooks) !== null && _a !== void 0 ? _a : (_b.webhooks = {}); | ||
this.rootDoc.webhooks[webhook] = webhookItem; | ||
@@ -144,0 +146,0 @@ return this; |
@@ -23,4 +23,3 @@ import * as yaml from 'yaml'; | ||
tags: [], | ||
servers: [], | ||
webhooks: {} | ||
servers: [] | ||
}; | ||
@@ -139,2 +138,4 @@ } | ||
addWebhook(webhook, webhookItem) { | ||
var _a; | ||
(_a = this.rootDoc).webhooks ?? (_a.webhooks = {}); | ||
this.rootDoc.webhooks[webhook] = webhookItem; | ||
@@ -141,0 +142,0 @@ return this; |
{ | ||
"name": "openapi3-ts", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "TS Model & utils for OpenAPI 3.x specification.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -25,4 +25,3 @@ import { OpenApiBuilder } from '.'; | ||
tags: [], | ||
servers: [], | ||
webhooks: {} | ||
servers: [] | ||
}); | ||
@@ -412,3 +411,3 @@ }); | ||
expect(sut).eql( | ||
`{"openapi":"3.0.0","info":{"title":"app9","version":"5.6.7"},"paths":{},"components":{"schemas":{},"responses":{},"parameters":{},"examples":{},"requestBodies":{},"headers":{},"securitySchemes":{},"links":{},"callbacks":{}},"tags":[],"servers":[],"webhooks":{}}` | ||
`{"openapi":"3.0.0","info":{"title":"app9","version":"5.6.7"},"paths":{},"components":{"schemas":{},"responses":{},"parameters":{},"examples":{},"requestBodies":{},"headers":{},"securitySchemes":{},"links":{},"callbacks":{}},"tags":[],"servers":[]}` | ||
); | ||
@@ -422,3 +421,3 @@ }); | ||
expect(sut).eql( | ||
'openapi: 3.0.0\ninfo:\n title: app9\n version: 5.6.7\npaths: {}\ncomponents:\n schemas: {}\n responses: {}\n parameters: {}\n examples: {}\n requestBodies: {}\n headers: {}\n securitySchemes: {}\n links: {}\n callbacks: {}\ntags: []\nservers: []\nwebhooks: {}\n' | ||
'openapi: 3.0.0\ninfo:\n title: app9\n version: 5.6.7\npaths: {}\ncomponents:\n schemas: {}\n responses: {}\n parameters: {}\n examples: {}\n requestBodies: {}\n headers: {}\n securitySchemes: {}\n links: {}\n callbacks: {}\ntags: []\nservers: []\n' | ||
); | ||
@@ -425,0 +424,0 @@ }); |
@@ -34,4 +34,3 @@ import * as yaml from 'yaml'; | ||
tags: [], | ||
servers: [], | ||
webhooks: {} | ||
servers: [] | ||
}; | ||
@@ -162,2 +161,3 @@ } | ||
addWebhook(webhook: string, webhookItem: oa.PathItemObject): OpenApiBuilder { | ||
this.rootDoc.webhooks ??= {}; | ||
this.rootDoc.webhooks[webhook] = webhookItem; | ||
@@ -164,0 +164,0 @@ return this; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92621
2439