
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@shapediver/util.oas3
Advanced tools
util.oas3
This utility-library enables to generate a OpenAPI v3 Specification (OAS) that has been defined by using JsDoc-like comments. The library also allows merging multiple existing OAS specifications. This enables the usage of partial specifications in separate projects and linking them dynamically later on.
Individual elements of the specification are created via JSDoc-like comments which the
structure @swagger {<path>} <name> <value>
.\
Notes:
/** */
-comments starting with the @swagger
-tag are processed.value
, watch strict validation of JSON-objects!The following example
/**
* @swagger {components.schemas} Foo {
"description": "Foo or Bar",
"type": "string",
"enum": [ "''", "foo", "bar" ]
}
*/
results in
{
"components": {
"schemas": {
"Foo": {
"description": "Foo or Bar",
"type": "string",
"enum": [
"''",
"foo",
"bar"
]
}
}
}
}
In this example, an array is created and extended via multiple comments. However, the similar element "bar" is ignored:
/**
* @swagger {components.schemas.Foo} required [ "foo", "bar" ]
* @swagger {components.schemas.Foo} required [ "bar", "baz" ]
*/
Result:
{
"components": {
"schemas": {
"Foo": {
"required": [
"foo",
"bar",
"baz"
]
}
}
}
}
In this example, an object is created, extended and partly overwritten via multiple comments:
/**
* @swagger {components.schemas} Foo {
"foo": "bar"
"baz": "qux"
}
* @swagger {components.schemas} Foo {
"baz": "bar"
}
*/
Result:
{
"components": {
"schemas": {
"Foo": {
"foo": "bar",
"baz": "bar"
}
}
}
}
This example shows how to specify and extend an object inside an array of objects:
/**
* @swagger {components.schemas} Foo {
"allOf": [
{ "$ref": "#/components/schemas/Bar" },
{ "type": "object" }
]
}
* @swagger {components.schemas.Foo.allOf.[1].properties} something {
"type": "number"
}
*/
Result:
{
"components": {
"schemas": {
"Foo": {
"allOf": [
{
"$ref": "#/components/schemas/Bar"
},
{
"type": "object",
"properties": {
"something": {
"type": "number"
}
}
}
]
}
}
}
}
The library can be installed globally or as a npm dependency and run via a CLI.
# List all commands and their options
./node_modules/.bin/sd-oas3 --help
# When adding ./node_modules/.bin to $PATH, the command can be invoked directly
sd-oas3 --help
# Generate a new specification
sd-oas3 generate -s ./src/ -e ts -o ./swagger.json
# Merge two existing specifications and write the result into a new file
sd-oas3 merge -s ./specA.json ./specB.json -f ./res.json
# Merge three existing specifications into another specification
sd-oas3 merge -s ./specA.json ./specB.json ./specC.json -t ./target.json
FAQs
Tool to generate a OpenAPI v3 specification from JsDocs
We found that @shapediver/util.oas3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.