Repository navigation
fix: upgrade @asyncapi/specs - #423
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
| */ | ||
| function preparePayloadSchema(asyncapiSchema) { | ||
| function preparePayloadSchema(asyncapiSchema, version) { | ||
| const payloadSchema = `http://asyncapi.com/definitions/${version}/schema.json`; |
There was a problem hiding this comment.
why can't we grab it from @asyncapi/specs instead of remote?
sorry if that was answered somewhere already. Also, I do not remember really much from times when I created asyncapiSchemaFormatParser.js
just dereferencing something in the parser from remote is going to slow down parsing, or?
There was a problem hiding this comment.
We are using the local one from @asyncapi/specs 🙂
It is only what the reference is called. Ajv automatically matches it with the schema inside definitions 🙂
There was a problem hiding this comment.
do we need http://asyncapi.com/definitions/ published before we merge?
tbh I'm not 100% sure how these $id work...to complicated for me 😄
There was a problem hiding this comment.
Not at all, the $ids when bundled together like so, do not need external access to the schemas 🙂 Because validation tools must look for the reference within before reaching externally.
We don't need to expose them at all if everyone uses the bundled schemas, but say you want to use this one: https://github.com/asyncapi/spec-json-schemas/blob/master/definitions/2.4.0/asyncapi.json, it would need the schemas exposed on http://asyncapi.com/definitions/ as the schemas are not located within.
Does that make sense?
|
Kudos, SonarCloud Quality Gate passed!
|
# Conflicts: # package-lock.json # package.json
|
PR is ready |
Co-authored-by: Lukasz Gornicki <[email protected]>
|
Kudos, SonarCloud Quality Gate passed!
|
|
@jonaslagoni sorry for being so late 😓 please solve conflicts and I can accept |
…chema # Conflicts: # package-lock.json
Done 👍 |
|
Kudos, SonarCloud Quality Gate passed!
|
|
🎉 This PR is included in version 1.15.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 2.0.0-next-major.18 🎉 The release is available on: Your semantic-release bot 📦🚀 |








Description
This PR upgrades the
@asyncapi/specslibrary to the new v3.One important note is, that with the new
@asyncapi/specspackage, the schema for validating JSON Schema's has to be removed in validation libraries. Why?Long story short, because the AsyncAPI JSON Schema documents are written with a specific meta schema. That meta schema, is already loaded by Ajv, and when you try to load the bundled AsyncAPI JSON Schema, it now contains that same meta schema, because we use it for payload validation. And Ajv does NOT like to load duplicate schemas and simply throw an error and cannot validate documents.
Related issue(s)
Blocked by asyncapi/spec-json-schemas#128