Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser looses information about kafka bindings on channel message level #228

Open
pkonopacki1 opened this issue Nov 16, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@pkonopacki1
Copy link

Describe the bug

When parsing AsyncAPI with the parser, the information about kafka bindings on channel message level are lost, only the type is retrieved.

How to Reproduce

    const {Parser} = require('@asyncapi/parser');
    const {AvroSchemaParser} = require('@asyncapi/avro-schema-parser');
    const parser = new Parser();
    parser.registerSchemaParser(AvroSchemaParser());

    const asyncapiWithAvro = `
asyncapi: 2.0.0
info:
  title: Example with Avro
  version: 0.1.0
channels:
  example:
    publish:
      message:
        schemaFormat: 'application/vnd.apache.avro;version=1.9.0'
        bindings:
          kafka:
            key:
              title: 'AsyncAPI title'
              description: 'AsyncaAPI binding description'
              type: string
              examples:
                - 'example value 1'
                - 'example value 2'
        payload: # The following is an Avro schema in YAML format (JSON format is also supported)
          type: record
          name: User
          namespace: com.company
          doc: User information
          fields:
            - name: displayName
              type: string
            - name: email
              type: string
            - name: age
              type: int`

    const {document} = await parser.parse(asyncapiWithAvro);`
Screenshot 2023-11-16 at 11 48 20

Expected behavior

The parsed document should contain also fields "title", "description", "examples"

@pkonopacki1 pkonopacki1 added the bug Something isn't working label Nov 16, 2023
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant