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

ajv-keywords

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ajv-keywords

Custom JSON-Schema keywords for Ajv validator

  • 4.0.0-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
49M
increased by2.66%
Maintainers
1
Weekly downloads
 
Created

What is ajv-keywords?

The ajv-keywords package extends AJV (Another JSON Schema Validator) with additional keywords for JSON schema validation. It allows for more complex validation scenarios beyond what is available in the standard JSON Schema.

What are ajv-keywords's main functionalities?

dynamicDefaults

Allows setting dynamic defaults for properties, such as generating timestamps for createdAt fields.

{"properties": {"createdAt": {"type": "string", "format": "date-time", "default": "dynamic", "dynamicDefault": "datetime"}}}

transform

Enables transformation of data before validation. For example, trimming whitespace and converting text to lowercase.

{"properties": {"email": {"type": "string", "transform": ["trim", "toLowerCase"]}}}

range

Introduces exclusive range validation for numeric values, allowing for minimum and maximum values to be exclusive.

{"properties": {"age": {"type": "number", "exclusiveRange": true, "minimum": 18, "maximum": 60}}}

Other packages similar to ajv-keywords

Keywords

FAQs

Package last updated on 24 Oct 2020

Did you know?

Socket

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.

Install

Related posts

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