@sleeksky/alt-swagger 2.3.0 → 2.3.1
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/package.json +2 -1
- package/src/index.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleeksky/alt-swagger",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Quickly spec your APIs for Swagger / OpenAPI interface",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"swagger-ui-express": "^4.1.6"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@sleeksky/alt-schema": "^2.1.0",
|
|
40
41
|
"lodash": "^4.17.21"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
package/src/index.js
CHANGED
|
@@ -63,8 +63,9 @@ function api(opt) {
|
|
|
63
63
|
const summary = (str) => { spec.summary = str; return ext; };
|
|
64
64
|
const desc = (str) => { spec.description = str; return ext; };
|
|
65
65
|
const deprecate = () => { spec.deprecated = true; return ext; };
|
|
66
|
+
const remove = () => { _.unset(paths, `${pathClean(opt.path)}.${opt.method}`); };
|
|
66
67
|
|
|
67
|
-
Object.assign(ext, { req, res, query, header, tag, summary, desc, deprecate });
|
|
68
|
+
Object.assign(ext, { req, res, query, header, tag, summary, desc, deprecate, remove });
|
|
68
69
|
|
|
69
70
|
// support all ext in parameters
|
|
70
71
|
Object.keys(ext).forEach(k => {
|