Socket
Socket
Sign inDemoInstall

@fastify/merge-json-schemas

Package Overview
Dependencies
Maintainers
19
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/merge-json-schemas

Builds a logical conjunction (AND) of multiple JSON schemas


Version published
Maintainers
19
Created

What is @fastify/merge-json-schemas?

@fastify/merge-json-schemas is an npm package designed to merge multiple JSON schemas into a single schema. This is particularly useful in Fastify applications where you might have multiple schemas for different parts of your application and you want to combine them for validation or other purposes.

What are @fastify/merge-json-schemas's main functionalities?

Basic Schema Merging

This feature allows you to merge two or more JSON schemas into a single schema. The resulting schema will include all properties from the input schemas.

{"const merge = require('@fastify/merge-json-schemas');":"","const schema1 = {":"","  type: 'object',":"","  properties: {":"","    name: { type: 'string' }":"","  }":"","};":"","const schema2 = {":"","    age: { type: 'number' }":"","const mergedSchema = merge([schema1, schema2]);":"","console.log(mergedSchema);":""}

Nested Schema Merging

This feature allows you to merge nested JSON schemas. The resulting schema will include nested properties from all input schemas.

{"const merge = require('@fastify/merge-json-schemas');":"","const schema1 = {":"","  type: 'object',":"","  properties: {":"","    address: {":"","      type: 'object',":"","      properties: {":"","        street: { type: 'string' }":"","      }":"","    }":"","  }":"","};":"","const schema2 = {":"","        city: { type: 'string' }":"","const mergedSchema = merge([schema1, schema2]);":"","console.log(mergedSchema);":""}

Other packages similar to @fastify/merge-json-schemas

Keywords

FAQs

Package last updated on 04 Sep 2024

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