angular-validated-resource
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "angular-validated-resource", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "JSON Schema validation for angular resource", | ||
@@ -5,0 +5,0 @@ "author": "Good Eggs <open-source@goodeggs.com>", |
@@ -22,3 +22,2 @@ # Angular Validated Resource | ||
require 'angular-validated-resource' | ||
# make sure you have angular-resource required somewhere too | ||
] | ||
@@ -31,14 +30,17 @@ | ||
isArray: true | ||
queryParamsSchema: require './product_schemas/query/query_params.json' # JSON schema to use for validating | ||
responseBodySchema: require './product_schemas/query/response_body.json' # JSON schema to use for validating | ||
queryParamsSchema: require './product_schemas/query/query_params.json' | ||
requestBodySchema: require './product_schemas/query/request_body.json' | ||
responseBodySchema: require './product_schemas/query/response_body.json' | ||
move: | ||
method: 'POST' | ||
url: 'http://api.test.com/products/:_id/move' | ||
params: {_id: '@_id'} | ||
requestBodySchema: require './product_schemas/move/request_body.json' # JSON schema to use for validating | ||
responseBodySchema: require './product_schemas/move/response_body.json' # JSON schema to use for validating | ||
queryParamsSchema: require './product_schemas/move/query_params.json' | ||
requestBodySchema: require './product_schemas/move/request_body.json' | ||
responseBodySchema: require './product_schemas/move/response_body.json' | ||
``` | ||
Note, if window.env is 'test', validation WILL NOT allow unknown fields. Otherwise, validation WILL allow unknown fields. | ||
If window.env is 'test', validation **will not** allow unknown fields. Otherwise, validation **will** allow unknown fields. | ||
Although not required, we strongly recommended that you validate all parts of the request (queryParams, requestBody, and responseBody) for every action, even if the validation is just checking for an empty object. This way, you will catch any unexpected data that you pass through. | ||
## Contributing | ||
@@ -45,0 +47,0 @@ |
Sorry, the diff of this file is not supported yet
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
13295
66