@kakkuk/serverless-aws-apigateway-documentation
Advanced tools
Comparing version 1.1.5 to 1.1.6
{ | ||
"name": "@kakkuk/serverless-aws-apigateway-documentation", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Serverless 1.0 plugin to add documentation and models to the serverless generated API Gateway", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -55,2 +55,60 @@ 'use strict'; | ||
}; | ||
//validation rules for 'documentation' property on 'http' event from 'aws' provider | ||
const docConfigSchema = { | ||
type: 'object', | ||
definitions: { | ||
models: { | ||
type: 'object', | ||
patternProperties: { '*/*': { type: 'string' } } | ||
}, | ||
body: { | ||
type: 'object', | ||
properties: { description: { type: 'string' } } | ||
}, | ||
arrayOfProps: { | ||
type: 'array', | ||
items: [ | ||
{ | ||
type: 'object', | ||
properties: { name: { type: 'string' }, description: { type: 'string' } }, | ||
required: [ 'name' ] | ||
} | ||
] | ||
} | ||
}, | ||
properties: { | ||
documentation: { | ||
type: 'object', | ||
properties: { | ||
summary: { type: 'string' }, | ||
description: { type: 'string' }, | ||
tags: { type: 'array', items: [ { type: 'string' } ] }, | ||
requestBody: { "'$ref'": '#/definitions/body' }, | ||
requestHeaders: { "'$ref'": '#/definitions/arrayOfProps' }, | ||
queryParams: { "'$ref'": '#/definitions/arrayOfProps' }, | ||
pathParams: { "'$ref'": '#/definitions/arrayOfProps' }, | ||
requestModels: { "'$ref'": '#/definitions/models' }, | ||
methodResponses: { | ||
type: 'array', | ||
items: [ | ||
{ | ||
type: 'object', | ||
properties: { | ||
statusCode: { type: 'number' }, | ||
responseBody: { "'$ref'": '#/definitions/body' }, | ||
responseHeaders: { "'$ref'": '#/definitions/arrayOfProps' }, | ||
responseModels: { "'$ref'": '#/definitions/models' } | ||
}, | ||
required: [ 'statusCode' ] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
//create schema for 'documentation' property | ||
this.serverless.configSchemaHandler.defineFunctionEventProperties('aws', 'http', docConfigSchema); | ||
} | ||
@@ -57,0 +115,0 @@ |
Sorry, the diff of this file is too big to display
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
175545
4540