Closed antonkomarev closed 2 years ago
You can inline external references like this:
$inputFile = 'file://tmp/yourfile.yaml'; // change this to a valid URI to your file.
$openApi = \cebe\openapi\Reader::readFromYamlFile($inputFile, \cebe\openapi\spec\OpenApi::class, ReferenceContext::RESOLVE_MODE_INLINE);
// use $openApi without external references here
// or write it to a file
\cebe\openapi\Writer::writeToYaml($openApi);
Thank you
Hi @cebe! Thank you for the package, you've done a great job!
I need to fetch openapi files with refs and compile them to the single inline file. I saw there is a way to make it in console command, but I want to do the same just in my controllers.
This is how I tried to make it:
But I still have yaml file with refs. How can I fetch all the refs and convert them to the single file?
// Spec files are not public, so
readFromYamlFile
is returning an error.