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

Does not support avro in AsynApi #57

Open
ikanel opened this issue Dec 7, 2022 · 1 comment
Open

Does not support avro in AsynApi #57

ikanel opened this issue Dec 7, 2022 · 1 comment

Comments

@ikanel
Copy link

ikanel commented Dec 7, 2022

Validation fails with the following error when the AsyncApi has an avro schema:

/Users/ikanel/code/SwaggerHub/node_modules/asyncapi-validator/src/Parser.js:27
throw new ValidationError(this._formatError(err), undefined, err.validationErrors)
^

AsyncAPIValidationError: PARSERS[String(...)] is not a function Error Details:
at Parser.parse (/Users/ikanel/code/SwaggerHub/node_modules/asyncapi-validator/src/Parser.js:27:13)
at async ValidatorFactory.fromSource (/Users/ikanel/code/SwaggerHub/node_modules/asyncapi-validator/src/ValidatorFactory.js:13:29)
at async file:///Users/ikanel/code/SwaggerHub/Contracts/AsyncApi/Validator/validate.js:6:10 {
key: undefined,
errors: undefined
}

Node.js v19.2.0

The fragment of the asynApi schema which causes this exception:

channels:
avroExample:
publish:
message:
#see https://github.com/asyncapi/avro-schema-parser
name: avro-message
schemaFormat: 'application/vnd.apache.avro;version=1.9.0'
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

@WaleedAshraf
Copy link
Owner

Yes, it doesn't support Avro schema. There is a package to add the support.
If you want, you may create PR.

Or I'll look into it later. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants