
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@api3/airnode-validator
Advanced tools
Package for JSON specifications validation. Validation process can be configured with validator templates.
@airnode/validatorPackage for JSON specifications validation. Validation process can be configured with validator templates.
The validator can be run as a yarn script, by providing template of specification, and the path to the JSON file of specification that will be validated:
yarn run validate --template="[template]" --specs="[specsFile]"
Templates are case-insensitive, valid templates are: config, OIS, apiSpecifications/apiSpecs, endpoints and
receipt:
yarn run validate --template="config" --specs="exampleSpecs/config.specs.json"
Validator will automatically validate the latest available version of provided template, in case a specific version should be used in validation, it can be appended to template argument:
yarn run validate --template="config@0.2.0" --specs="exampleSpecs/config.specs.json"
Custom templates can be used, by providing path to the validator template file in place of template:
yarn run validate --template="templates/0.2.0/config.json" --specs="exampleSpecs/config.specs.json"
Above mentioned commands will return json in following format:
{
valid: boolean,
messages: { level: "error" | "warning", message: string }[]
}
valid is set to true in case there are no errors, however there can be still warnings in the messages.
Validator behavior can be configured with validator templates, which are regular json files using special keywords for
specification validation. Usage of these keywords is described in the following chapters:
@airnode/convertorBuilt-in validator extension capable of conversions between various specifications, conversions are configured using validator templates with conversion actions.
Convertor works the same way as validator and can be invoked with the convert command, for example:
yarn run convert --template="conversions/oas@3.0.0------ois@0.2.0.json" --specs="exampleSpecs/OAS.specs.json"
Conversions can be invoked without providing any template, specifying which format provided specification is in and to which format it should be converted into, is enough:
yarn run convert --from="OAS" --to="OIS" --specs="exampleSpecs/OAS.specs.json"
Specification formats are case-insensitive, currently available conversions are from OAS to OIS or from OIS to
config. Version of the format can be provided as in validate command:
yarn run convert --from="OIS@pre-alpha" --to="config@pre-alpha" --specs="exampleSpecs/ois.specs.json"
On top of validator output, convertor provides an output object, which contains the converted specification:
{
valid: boolean,
messages: { level: "error" | "warning", message: string }[],
output: object
}
Alternatively command can be ran with argument --specs-only, which will return only the converted specification.
Convertor uses the same templates as validator. The resulting specification can be written into output object with
actions.
Source documentation markdown files are located in docs/src/ directory. All template related examples are located in
test/fixtures/ and injected into markdown using
markdown-snippet-injector by running yarn run docs.
Generated markdown files can be found in docs/, test files using the same examples can be found in test/ directory.
FAQs
> A package/CLI tool that can be used to validate and convert airnode specification files
The npm package @api3/airnode-validator receives a total of 330 weekly downloads. As such, @api3/airnode-validator popularity was classified as not popular.
We found that @api3/airnode-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.