Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@asyncapi/specs
Advanced tools
If you are currently using version 2, check out migration guideline to version 3. You might be able to update it without any change.
This is a mono repository, which provides all the JSON Schema documents for validating AsyncAPI documents.
If you decide to validate AsyncAPI documents only with the JSON Schema files provided in this repo, your AsyncAPI documents will not be properly validated. It's recommended to use AsyncAPI JavaScript Parser that uses the AsyncAPI JSON Schema files for validation but also implements additional custom validations.
The following additional custom validations need to be provided:
securitySchemes
definition in components
with the same name.securitySchemes
is an empty array when the security type requires it.servers
property are declared in the top-level servers
object.At the moment, AsyncAPI JavaScript parser do not cover all validation cases yet All test cases and parsers coverage can be found here
npm install @asyncapi/specs
go get github.com/asyncapi/spec-json-schemas/v2
Grab a specific AsyncAPI version:
const asyncapi = require('@asyncapi/specs/schemas/2.0.0');
// Do something with the schema.
Get a list of versions:
const versions = require('@asyncapi/specs');
console.log(versions);
// Outputs:
//
// {
// '1.0.0': [Object],
// '1.1.0': [Object]
// }
const asyncapi = versions['1.1.0'];
// Do something with the schema.
Grab a specific AsyncAPI version:
import "github.com/asyncapi/spec_json_schemas/v2"
func Do() {
schema, err := spec_json_schemas.Get("1.1.0")
if err != nil {
panic(err)
}
// Do something with the schema
}
This is the current project structure explained.
Changes should not be done manually to the schemas in ./schemas, but instead be done in their individual definitions located in ./definitions.
These definitions are automatically bundled together on new releases through the npm script prepublishOnly
, which ensures the project is build. This is where the bundler is called.
For example, for 2.2.0, the bundler starts with the asyncapi.json file and recursively goes through all references ($ref
) to create the appropriate bundled version.
To create a new version, simply run the following command:
npm run startNewVersion --new-version=x.x.x
Where x.x.x
is the new version you want to create.
The manual process of creating a new version is to:
y.y.y
) under definitions (so we have the correct base to make changes from).x.x.x
).y.y.y
and replace it with x.x.x
.'2.5.0': require('./schemas/2.5.0.json'),
.oneOf
keyword with the new version. I.e.:
{
"allOf":[
{
"properties":{
"asyncapi":{
"const":"2.5.0"
}
}
},
{
"$ref":"http://asyncapi.com/schema-store/2.5.0.json"
}
]
}
FAQs
AsyncAPI schema versions
The npm package @asyncapi/specs receives a total of 295,981 weekly downloads. As such, @asyncapi/specs popularity was classified as popular.
We found that @asyncapi/specs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.