protected function execute(InputInterface
$input, OutputInterface
$output): int
{ $validatorURL =
$input->
getArgument('validatorUrl'
);
$apiType =
match ($input->
getOption('api-type'
)) { DefinitionService::API => DefinitionService::API,
DefinitionService::STORE_API => DefinitionService::STORE_API,
default =>
throw new \
InvalidArgumentException('Invalid --api-type, must be one of "api" or "store-api"'
),
};
$schema =
$this->definitionService->
generate( OpenApi3Generator::FORMAT,
$apiType,
);
$response =
$this->client->
request('POST',
$validatorURL,
[ 'json' =>
$schema,
'headers' =>
[ 'Accept' => 'application/json',
],
]);
$content =
$response->
toArray();