Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
angular-validated-resource
Advanced tools
JSON Schema validation for angular resource.
npm install angular-validated-resource
Designed to be an (almost) drop-in replacement for angular resource. When you configure the resource actions, additionally pass a schema to queryParamsSchema
, requestBodySchema
, or responseBodySchema
to automatically validate on every request.
angular.module 'Product', [
require 'angular-validated-resource'
# make sure you have angular-resource required somewhere too
]
.factory 'Product', ngInject (validatedResource) ->
validatedResource 'http://api.test.com/products/:_id', {_id: '@_id'},
query:
method: 'GET'
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
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
Note, if window.env is 'test', validation WILL NOT allow unknown fields. Otherwise, validation WILL allow unknown fields.
Please follow our Code of Conduct when contributing to this project.
$ git clone https://github.com/goodeggs/angular-validated-resource && cd angular-validated-resource
$ npm install
$ npm test
Module scaffold generated by generator-goodeggs-npm.
FAQs
JSON Schema validation for angular resource
The npm package angular-validated-resource receives a total of 0 weekly downloads. As such, angular-validated-resource popularity was classified as not popular.
We found that angular-validated-resource demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.