
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
@swagger-api/apidom-json-path
Advanced tools
Evaluate JSONPath expressions against ApiDOM.
apidom-json-path
is a package that evaluates JSONPath expressions against ApiDOM.
You can install this package via npm CLI by running the following command:
$ npm install @swagger-api/apidom-json-path
Package contains JSONPath evaluation functions for evaluating single or multiple JSONPath expression.
Suited for evaluating single JSONPath expression against ApiDOM.
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate } from '@swagger-api/apidom-json-path';
const apidom = new ObjectElement({
a: {
b: [100, 1, 2],
},
});
const result = evaluate('$.a.b[?(@ < 10)]', apidom);
// =>
// [
// NumberElement(1),
// NumberElement(2),
// ]
Suited for evaluating multiple JSONPath expression against the same ApiDOM. Use this function in cases when you have multiple JSONPath expressions that need to be evaluated against single ApiDOM fragment.
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluateMulti } from '@swagger-api/apidom-json-path';
const apidom = new ObjectElement({
a: {
b: [100, 1, 2],
},
});
const resultMulti = evaluateMulti(['$.a.b[?(@ < 10)]', '$.a.b[?(@ > 10)]'], apidom);
// => returns list of tuples which represents mappings between paths and end point values
// [
// ['$.a.b[?(@ < 10)]', [NumberElement(1), NumberElement(2)]],
// ['$.a.b[?(@ > 10)]', [NUmberElement(100)]],
// ]
If either evaluate
or evaluateMulti
functions are provided with invalid JSONPath expressions,
they don't throw errors, but they rather return empty list of end point values.
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate, evaluateMulti } from '@swagger-api/apidom-json-path';
const apidom = new ObjectElement({
a: {
b: [100, 1, 2],
},
});
const result = evaluate('%~!@U@IU$@', apidom); // => []
const resultMulti = evaluateMulti(['%~!@U@IU$@', 'd*AS&*)(&YR3R'], apidom); // => []
1.0.0-beta.44 (2025-07-07)
FAQs
Evaluate JSONPath expressions against ApiDOM.
The npm package @swagger-api/apidom-json-path receives a total of 2,127 weekly downloads. As such, @swagger-api/apidom-json-path popularity was classified as popular.
We found that @swagger-api/apidom-json-path demonstrated a healthy version release cadence and project activity because the last version was released less than 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
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.