fix: filter out $ref keys in bindings() to prevent undefined parser error#1196
fix: filter out $ref keys in bindings() to prevent undefined parser error#1196AayushSaini101 wants to merge 5 commits into
Conversation
…utput Fixes asyncapi#877 When bindings objects still contain JSON reference keys, treat them as references rather than protocol names so Binding models are not built from invalid data. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: f53a796 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@asyncapi/microgrant_team |
princerajpoot20
left a comment
There was a problem hiding this comment.
I tried the adeo file against this PR branch and still get document: undefined with the same schema-format error.
Can you try it on your end with this file and share the findings: https://github.com/asyncapi/spec/blob/master/examples/adeo-kafka-request-reply-asyncapi.yml
When a schema format is not registered, return the raw schema and continue parsing so documents with bindings and other metadata remain accessible without requiring AvroSchemaParser registration. Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
Done @princerajpoot20
Tested via this script: |
| export async function parseSchema(parser: Parser, input: ParseSchemaInput): Promise<AsyncAPISchema> { | ||
| const schemaParser = parser.parserRegistry.get(input.schemaFormat); | ||
| if (schemaParser === undefined) { | ||
| throw new Error('Unknown schema format'); |
There was a problem hiding this comment.
this is the reason it was failing for avro schema parsing, if there is any spec containing avro schema parsing, we need to register manually otherwise it will raise an error cc: @princerajpoot20




Fixes #877
Related: #1167
When bindings objects still contain JSON reference keys, treat them as references rather than protocol names so Binding models are not built from invalid data.