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.
The current bundling approach in libopenapi automatically inlines all refs in files other than the root file. The
BundleInlineRefs
option indatamodel.DocumentConfiguration
appears to only affect the root file. When set totrue
, refs in the root file are inlined. When set tofalse
, refs within the root file, i.e. to thecomponents
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.
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.