
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
papilio-util
Advanced tools
var schema = require('schema-util').schema;
var json = schema(`
array(foo) {
href(href),
title(title),
img.image(image url),
amount(money amout)
}
`);
// json should be so:
/**
{
type: 'array',
description: 'foo',
properties: {
href: { description: 'href', type: 'string' },
title: { description: 'title', type: 'string' },
img: { description: 'image url', type: 'image' },
amount: { description: 'money amount', type: 'string' }
}
}
*/
And nest rule supported:
var json = schema(`
object(abc) {
title(title),
user.object(user) {
name(user name),
age.number(user age)
}
}
`, ['number']);
The secend argument, you can add some more type support, such as
age.number, background.color.
schema(`array(foo) { a(a)}`, types)
The defaultType is 'string', If you want change this, you need send the secend argument like this:
schema(`array(foo) { a(a)}`, {
defaultType: 'number',
supported: ['string']
});
FAQs
Better for human write schema define
The npm package papilio-util receives a total of 0 weekly downloads. As such, papilio-util popularity was classified as not popular.
We found that papilio-util 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.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.