
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
json-schema-deref-local
Advanced tools
Dereference local JSON pointers in a JSON schema with their true resolved values. Basically a lighter, local-only version of json-schema-deref-sync but omits web references, file references, and custom loaders.
This local-only fork removes the dependency on the Node.js fs
module, allowing it to be used either in Node.js or in a web browser.
npm install SeedScientific/json-schema-deref-local
Let's say you have the following JSON Schema:
{
"description": "Just some JSON schema.",
"title": "Basic Widget",
"type": "object",
"definitions": {
"id": {
"description": "unique identifier",
"type": "string",
"minLength": 1,
"readOnly": true
}
},
"properties": {
"id": {
"$ref": "#/definitions/id"
}
}
}
Sometimes you just want that schema to be fully expanded, with $ref
s being their (true) resolved values:
{
"description": "Just some JSON schema.",
"title": "Basic Widget",
"type": "object",
"definitions": {
"id": {
"description": "unique identifier",
"type": "string",
"minLength": 1,
"readOnly": true
}
},
"properties": {
"id": {
"description": "unique identifier",
"type": "string",
"minLength": 1,
"readOnly": true
}
}
}
This utility lets you do that:
var deref = require('json-schema-deref-local');
var myschema = require('schema.json');
var fullSchema = deref(myschema);
Dereferences $ref
's in json schema to actual resolved values. Supports local refs only (ie. refs starting with '#' referring to definitions in the same schema file).
Parameters:
schema
The input JSON schema
Gets the "local" ref value given the path.
schema
- the (root) json schema to search
refPath
- string ref path to get within the schema. Ex. #/definitions/id
var localValue = deref.getRefPathValue(myschema, '#/definitions/foo');
console.dir(localValue);
FAQs
Simple JSON Schema local dereferencer
The npm package json-schema-deref-local receives a total of 81 weekly downloads. As such, json-schema-deref-local popularity was classified as not popular.
We found that json-schema-deref-local 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.