[BUG] incorrect x-parser-schema-id when having multiple files
- Dominant language
- TypeScript
- Stars
- 144
- Forks
- 144
- Avg merge
- 6m
- Merged PRs (30d)
- 11
Description
### Describe the bug.
I am encountering an issue with my `asyncapi.yml` file, which references schemas located in another file. When I generate the models, the generator creates generic names like `AnonymousSchema_1`, `AnonymousSchema_2`, `AnonymousSchema_3`, and so on for each schema in the referenced file.
After investigating the problem, I discovered that it seems to stem from the parser. Specifically, the `x-parser-schema-id` field in the `AsyncAPIDocumentInterface` object is returning values like ``.
### Expected behavior
I would expect the generated models to have the right name.
### Screenshots


### How to Reproduce
I will leave a PR that reproduces the error with tests.
I can try fixing the error, but I need guidance here.
Here is the reproduction: https://github.com/asyncapi/parser-js/pull/1064
### 🥦 Browser
None
### 👀 Have you checked for similar open issues?
- [X] I checked and didn't find similar issue
### 🏢 Have you read the Contributing Guidelines?
- [X] I have read the [Contributing Guidelines](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md)
### Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Contributor guide
Research direction
Start with the reproduction and tests in PR #1064, then trace how AsyncAPIDocumentInterface assigns x-parser-schema-id when schemas are referenced from another file. Done means the referenced schemas receive their correct names instead of AnonymousSchema_N values, with the reproduction tests passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100