
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@maeum/schema-controller
Advanced tools
The @maeum/schema-controller is a package that helps developer to integreate schema-nozzle and fastify.js. Developer can generate a json-schema via schema-nozzle and then use as a schema in fastify.js request/response.
Why use @maeum/schema-controller?
npm install @maeum/schema-controller --save
import fastify from 'fastify';
import { SchemaController } from '@maeum/schema-controller';
const listen = () => {
// step 01. bootstrap your json-schema database
SchemaController.bootstrap(false, {
// set your json-schema database file-path
filePath: path.join(getCwd(process.env), 'resources', 'configs', 'store.json'),
});
const server = fastify()
// step 02. your schema controller pass to fastify.js
server.setSchemaController(SchemaController.it.getFastifyController(server));
}
listen();
The schema-nozzle generate as json-schema database file that is available in @maeum/schema-controller. This generated json-schema database file is read from @ameum/schema-controller and then use to set up the schema in fastify.js routing.
server.post('/pet', { schema: { querystring: { $ref: 'ICreatePetDto' } } }, (req: FastifyRequest<{ Querystring: ICreatePetDto }>, reply) => {
// ...your code
// You can use auto-complete and intellisence Request Object like that,
// `req.query.name`
})
flowchart LR
SN[schema-nozzle]
DB[store.json]
SC[schema-controller]
RC[fastify.js<br /> route configuration<br /> swagger document]
SN-->|TypeScript interface<br />convert to json-schema|DB
DB-->SC
SC-->|fastify.js schema-controller|RC
fastify.js uses ajv for request data validation. If you want to change the options of the ajv instance, you can pass custom options as shown below.
SchemaController.bootstrap(false, {
filePath: path.join(getCwd(process.env), 'resources', 'configs', 'store.json'),
ajv: {
// custom option of ajv instance
options: {
coerceTypes: 'array',
keywords: ['collectionFormat', 'example', 'binary'],
formats: {
binary: { type: 'string', validate: () => true },
byte: { type: 'string', validate: () => true },
},
},
// extension apply on ajv
extension: (ajv) => {
ajvFormat(ajv);
},
});
This software is licensed under the MIT.
FAQs
maeum framework schema-controller
We found that @maeum/schema-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.