Avro schemas are not supported in the components/schemas section
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 382
- Avg merge
- 7m
- Merged PRs (30d)
- 4
Description
### Describe the bug
Asyncapi supports Avro schemas, but only if they are in the message/payload section. It would be nice if we could put Avro schemas in the components/schemas section.
### To Reproduce
Steps to reproduce the behavior:
1. Create a document with an Avro schema in components/schemas. It will fail in the playground.
### Expected behavior
The document should parse as it does when the schema is in the message/payload section.
### Sample document
```yaml
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'
payload:
$ref: '#components/schemas/mySchema'
components:
schemas:
mySchema:
type: record
doc: User information
fields:
- name: displayName
type: string
```
Contributor guide
Research direction
Reproduce the sample document in the AsyncAPI playground and compare it with the working message/payload placement. Trace how the components/schemas reference is handled, then verify that the sample document parses successfully with the Avro record in components/schemas.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100