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

Sort locally-stored referenced files as well? #13

Open
philCryoport opened this issue Dec 28, 2022 · 2 comments
Open

Sort locally-stored referenced files as well? #13

philCryoport opened this issue Dec 28, 2022 · 2 comments
Labels

Comments

@philCryoport
Copy link

Hi there,

For readability and re-usability, we have extracted the schemas out of the primary AsyncAPI YAML file into a file ./components/schemas.yaml -- and then have lots of $ref entries in the main AsyncAPI YAML file, i.e.:

...
schemas:
  foo_enum:
     $ref: './components/schemas.yaml#/components/schemas/foo_enum'

How do I use the application to sort that child / referred-to file?

@thim81 thim81 added the feature label Dec 28, 2022
@thim81
Copy link
Owner

thim81 commented Dec 28, 2022

hi @philCryoport

At the moment, it does not sort $ref elements.
Although that is a very valuable feature, so I'll put it on the list of future features.

There is one limitation, last time I did an investigation around this feature, I found that sorting $ref files means that all the $ref need to be dereferenced, resulting in a single output file.

My guess is that you want to be able to sort the async file with $ref and have the $ref files themselves updated and not one dereferenced async.yaml file?

@philCryoport
Copy link
Author

My guess is that you want to be able to sort the async file with $ref and have the $ref files themselves updated and not one dereferenced async.yaml file?

Hi @thim81 correct!

My hope was that the end result of sorting would be:

  • parent YAML file is sorted
  • each child YAML file referred-to-in-parent-YAML would also be sorted

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

No branches or pull requests

2 participants