![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
asyncapi-docgen
Advanced tools
AsyncAPI Documentation Generator
Use your AsyncAPI definition to generate beautiful
human-readable documentation for your API.
To use it from the CLI:
npm install -g asyncapi-docgen
To use it as a module in your project:
npm install --save asyncapi-docgen
Usage: adg [options] <asyncAPI>
Options:
-V, --version output the version number
-o, --output <outputDir> directory where to put the generated files (defaults to current directory)
-h, --help output usage information
The shortest possible syntax:
adg asyncapi.yaml
Specify where to put the generated documentation:
adg asyncapi.yaml -o ./docs
Place a file called asyncapi.yaml
in the same directory as the following script, and then run it. You can obtain the content of the file from editor.asyncapi.org, not included here for brevity.
Note that you'll need to install
asyncapi-docgen
for it to work. Either runnpm install asyncapi-docgen
in your terminal or add it to yourpackage.json
file as a dependency.
const fs = require('fs');
const path = require('path');
const docs = require('asyncapi-docgen');
// Read file content
const asyncapi = fs.readFileSync(path.resolve(__dirname, 'asyncapi.yaml'), 'utf8');
(async function() {
try {
const html = await docs.generateFullHTML(asyncapi);
console.log('Done!');
console.log(html);
} catch (e) {
console.error(`Something went wrong: ${e.message}`);
}
})();
const fs = require('fs');
const path = require('path');
const docs = require('asyncapi-docgen');
// Read file content
const asyncapi = fs.readFileSync(path.resolve(__dirname, 'asyncapi.yaml'), 'utf8');
docs
.generateFullHTML(asyncapi)
.catch((err) => {
console.error(`Something went wrong: ${err.message}`);
})
.then((html) => {
console.log('Done!');
console.log(html);
});
This package makes use of two different custom specification extensions:
Extension | Path | Description |
---|---|---|
x-logo | /info | URL of the logo rendered on the top left corner of the documentation. |
x-topic-separator | / | A string to use as the topic separator. |
Custom logo:
asyncapi: '1.0.0'
info:
title: My API
x-logo: https://your-company.com/logo.png
MQTT-style topic separator:
asyncapi: '1.0.0'
x-topic-separator: '/'
ATTENTION: This will not replace your topic separators. E.g., if your baseTopic is
my.company
and one of your topics isuser.signup
, the result of concatenating both, in the example above, would bemy.company/user.signup
and notmy/company/user/signup
. If you aim for the latter, your baseTopic should bemy/company
and your topic should beuser/signup
.
Fran Méndez (@fmvilas)
FAQs
An AsyncAPI documentation generator.
The npm package asyncapi-docgen receives a total of 0 weekly downloads. As such, asyncapi-docgen popularity was classified as not popular.
We found that asyncapi-docgen 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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.