libopenapi icon indicating copy to clipboard operation
libopenapi copied to clipboard

Add support for different bundling modes - compose bundle mode

Open stcalica opened this issue 8 months ago • 0 comments

This is a continuation of the work done here form @felixjung

The current bundling approach in libopenapi automatically inlines all refs in files other than the root file. The BundleInlineRefs option in datamodel.DocumentConfiguration appears to only affect the root file. When set to true, refs in the root file are inlined. When set to false, refs within the root file, i.e. to the components section, are kept where they are, while refs made to other files are inlined nevertheless.

The goal of this PR is to introduce different bundling modes.

The first mode inlines all references.
The second mode tracks all references across all files and ensures that they are moved to the appropriate sub-section of the components section or other sections (as necessary) in the bundled spec.
The bundle mode can be configured in a new BundlerOptions struct passed to the bundling functions of the bundler package.

stcalica avatar Apr 16 '25 21:04 stcalica