asyncapi / optimizer

AsyncAPI offers many different ways to reuse certain parts of the document like messages or schemas definitions or references to external files, not to even mention the traits. There is a need for a tool that can be plugged into any workflows and optimize documents that are generated from code, but not only.
Apache License 2.0
14 stars 9 forks source link

[BUG] File Reading Method in the Example script is not appropriate #251

Closed KhudaDad414 closed 3 months ago

KhudaDad414 commented 3 months ago

Describe the bug.

The example script uses relative paths (./examples/input.yaml and ./examples/output.yaml) to handle file reading and writing operations, it will fail if executed from different directories.

Expected behavior

The script should manage file paths using the __dirname variable to ensure consistent behaviour irrespective of the current execution directory. This will ensure correct file referencing at all times.

Screenshots

-

How to Reproduce

  1. clone the project.
  2. compile it with npm run dev
  3. run cd examples then node index.js

🥦 Browser

Other

👀 Have you checked for similar open issues?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

KhudaDad414 commented 3 months ago

/gfi js

omidNM24 commented 3 months ago

Hi @KhudaDad414, can I work on this issue?

KhudaDad414 commented 3 months ago

Sure. 👍

asyncapi-bot commented 3 months ago

:tada: This issue has been resolved in version 1.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: