Why do we need this improvement?
Despite being called bundler it does dereferencing, which blocks the use of it for schemas with circular references.
json-schema-ref-parser used under the hood has mutiple options for handling circular refs and even a dedicated bundle function for actually bundeling.
moreover, further down the asyncapi stack circular refs are not a problem, e.g. modelina can handle schemas with circular refs and generate code for those.
How will this change help?
it will unblock the use of bundler for cases with circular refs and make the tool more close functions-wise to its name.
Screenshots
No response
How could it be implemented/designed?
default behavior can remain the same, and additional option may enable a behavior of really just bundling
also mixed dereference via dereference.circular=ignore can be achieved.
from the first look at the code base it can be a single additional cli arg (e.g. named strategy) describing the desired behaviours:
- dereference all (default and current behavior)
- dereference circular
- dereference all except circular
- bundle (via using
json-schema-ref-parser's bundle)
no real complexity of the change, but quite some additional value for the tool.
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue?
Yes I am willing to submit a PR!
Why do we need this improvement?
Despite being called
bundlerit does dereferencing, which blocks the use of it for schemas with circular references.json-schema-ref-parserused under the hood has mutiple options for handling circular refs and even a dedicatedbundlefunction for actually bundeling.moreover, further down the
asyncapistack circular refs are not a problem, e.g.modelinacan handle schemas with circular refs and generate code for those.How will this change help?
it will unblock the use of
bundlerfor cases with circular refs and make the tool more close functions-wise to its name.Screenshots
No response
How could it be implemented/designed?
default behavior can remain the same, and additional option may enable a behavior of really just bundling
also mixed dereference via dereference.circular=ignore can be achieved.
from the first look at the code base it can be a single additional cli arg (e.g. named
strategy) describing the desired behaviours:json-schema-ref-parser'sbundle)no real complexity of the change, but quite some additional value for the tool.
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue?
Yes I am willing to submit a PR!