-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from calcinai/oapi-3
OAS 3.0 compatibility
- Loading branch information
Showing
10 changed files
with
100 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
* @package gendarme | ||
* @author Michael Calcinai <[email protected]> | ||
*/ | ||
|
||
namespace Calcinai\Gendarme\Command; | ||
|
||
use Calcinai\Gendarme\Generator; | ||
|
@@ -15,9 +16,11 @@ | |
use Symfony\Component\Console\Input\InputOption; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class GenerateCommand extends Command { | ||
class GenerateCommand extends Command | ||
{ | ||
|
||
protected function configure() { | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('generate') | ||
->setDescription('Generate classes representing the JSON schema') | ||
|
@@ -44,21 +47,25 @@ protected function configure() { | |
InputOption::VALUE_OPTIONAL, | ||
'The name of the root generated schema', | ||
'Schema' | ||
) | ||
; | ||
); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output){ | ||
|
||
|
||
/** | ||
* @param InputInterface $input | ||
* @param OutputInterface $output | ||
* @return int|void|null | ||
* @throws \ReflectionException | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$schema_file = $input->getArgument('schema'); | ||
$output_dir = $input->getArgument('output'); | ||
|
||
if(!file_exists($schema_file)){ | ||
if (!file_exists($schema_file)) { | ||
throw new InvalidArgumentException('Invalid schema provided'); | ||
} | ||
|
||
if(!file_exists($output_dir)){ | ||
if (!file_exists($output_dir)) { | ||
throw new InvalidArgumentException('Invalid output directory provided'); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters