public function generate(array
$definitions, string
$api, string
$apiType = DefinitionService::TYPE_JSON_API, ?string
$bundleName = null
): array
{ $forSalesChannel =
$this->
containsSalesChannelDefinition($definitions);
$openApi =
new OpenApi([]);
$this->openApiBuilder->
enrich($openApi,
$api);
ksort($definitions);
foreach ($definitions as $definition) { if (!
$this->
shouldDefinitionBeIncluded($definition)) { continue;
} $onlyFlat =
match ($apiType) { DefinitionService::TYPE_JSON => true,
default =>
$this->
shouldIncludeReferenceOnly($definition,
$forSalesChannel),
};
$schema =
$this->definitionSchemaBuilder->
getSchemaByDefinition( $definition,
$this->
getResourceUri($definition),