Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-reqvalidator-plugin

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-reqvalidator-plugin - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "serverless-reqvalidator-plugin",
"version": "1.0.2",
"version": "1.0.3",
"description": "Serverless plugin for setting request validation",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -72,3 +72,3 @@ # serverless-reqvalidator-plugin

resources:
Resource:
Resources:
xMyRequestValidator:

@@ -105,2 +105,107 @@ Type: "AWS::ApiGateway::RequestValidator"

Fn::ImportValue: 'myReqValidator'
```
```
### Full example
```
service:
name: my-service
plugins:
- serverless-webpack
- serverless-reqvalidator-plugin
- serverless-aws-documentation
provider:
name: aws
runtime: nodejs6.10
region: eu-west-2
environment:
NODE_ENV: ${self:provider.stage}
custom:
documentation:
api:
info:
version: '1.0.0'
title: My API
description: This is my API
tags:
-
name: User
description: User Management
models:
- name: MessageResponse
contentType: "application/json"
schema:
type: object
properties:
message:
type: string
- name: RegisterUserRequest
contentType: "application/json"
schema:
required:
- email
- password
properties:
email:
type: string
password:
type: string
- name: RegisterUserResponse
contentType: "application/json"
schema:
type: object
properties:
result:
type: string
- name: 400JsonResponse
contentType: "application/json"
schema:
type: object
properties:
message:
type: string
statusCode:
type: number
commonModelSchemaFragments:
MethodResponse400Json:
statusCode: '400'
responseModels:
"application/json": 400JsonResponse
functions:
signUp:
handler: handler.signUp
events:
- http:
documentation:
summary: "Register user"
description: "Registers new user"
tags:
- User
requestModels:
"application/json": RegisterUserRequest
method: post
path: signup
reqValidatorName: onlyBody
methodResponses:
- statusCode: '200'
responseModels:
"application/json": RegisterUserResponse
- ${self:custom.commonModelSchemaFragments.MethodResponse400Json}
package:
include:
handler.ts
resources:
Resources:
onlyBody:
Type: "AWS::ApiGateway::RequestValidator"
Properties:
Name: 'only-body'
RestApiId:
Ref: ApiGatewayRestApi
ValidateRequestBody: true
ValidateRequestParameters: false
```

@@ -50,3 +50,3 @@ 'use strict';

this.hooks = {
'before:deploy:deploy': this._beforeDeploy
'before:package:finalize': this._beforeDeploy
};

@@ -109,2 +109,2 @@

module.exports = ServerlessReqValidatorPlugin;
module.exports = ServerlessReqValidatorPlugin;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc