[BUG] external files in same directory are not resolved via $ref anymore, since v3.3.0
Describe the bug.
We've externalized parts of the asyncapi contract into separate files and reference them via $ref.
These files are located in the same directory.
File: src/contract/asyncapi.yaml:
...
components:
messages:
MyMessage:
title: "My message"
traits:
- $ref: "my-event-headers.yaml#/components/messageTraits/event-headers-definition"
headers:
type: object
properties:
x_origin:
const: my_project
x_event_type:
allOf:
- $ref: "my-event-models.yaml#/components/schemas/EventTypeName"
- const: EVENT_TYPE_NAME
x_grouping_key:
$ref: "my-event-models.yaml#/components/schemas/Id"
payload:
$ref: "my-event-models.yaml#/components/schemas/MyPayload"
bindings:
kafka:
key:
$ref: "my-event-headers.yaml#/components/schemas/GroupingKeyHeader"
...
Since asyncapi-cli v3.3.0 this doesn't work anymore if all files are in a subdirectory like src/contract.
As a workaround we have to copy all files into the current working directory. Then it works.
I've also tried to prefix the path reference with ./, but it didn't work either.
Expected behavior
Read all referenced files in the same directory as in version 3.2.0
Screenshots
n.a.
How to Reproduce
Create an asyncapi contract in a subdirectory and reference other yaml files in the same directory. Run the asyncapi-cli generator.
🖥️ Device Information [optional]
- Operating System (OS):
- Browser:
- Browser Version:
👀 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
Are you willing to work on this issue ?
None
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.
We are also hit by this issue.
Picking up this issue
This issue still exists. @neoandmatrix could you please put the screenshots here.
This issue still exists. @neoandmatrix could you please put the screenshots here.
Just tested these and yes the issue persists. I believe it is a problem related with the generator specifically since it was mentioned specifically in the issue. Just to confirm i tried generate command on latest master branch commit and it still fails. Below is screenshot for further reference.