
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@fastify/any-schema
Advanced tools
Save multiple schemas and decide which one use to serialize the payload Edit
Save multiple schemas and decide which one to use to serialize the payload.
Internally uses fast-json-stringify to compile the schemas in extremely fast serialization functions, with all the benefits given by the library, such as preventing the leaking of sensitive data.
npm i @fastify/any-schema
Register the plugin and pass to it an array of schemas with an id, then use reply.schema(id) to decide which schema to use to serialize your data.
const fastify = require('fastify')()
fastify.register(require('@fastify/any-schema'), {
schemas: [{
$id: 'schema1',
type: 'object',
properties: {
hello: { type: 'string' }
}
}, {
$id: 'schema2',
type: 'object',
properties: {
winter: { type: 'string' }
}
}]
})
fastify.get('/:schema', (req, reply) => {
reply
.schema(req.params.schema)
.send({ hello: 'world' })
})
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
This project is kindly sponsored by:
Licensed under MIT.
FAQs
Save multiple schemas and decide which one use to serialize the payload Edit
The npm package @fastify/any-schema receives a total of 3 weekly downloads. As such, @fastify/any-schema popularity was classified as not popular.
We found that @fastify/any-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.