-
-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add command to generate json schema #2996
add command to generate json schema #2996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost good! Just one little more change. The CI must also be green (PHP CS Fixer, PHPStan etc).
1736836
to
4b9405d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the CI will be green!
49bb11d
to
672949c
Compare
->setName('api:json-schema:generate') | ||
->setDescription('Generates the JSON Schema for a resource operation.') | ||
->addArgument('resource', InputArgument::REQUIRED, 'The Fully Qualified Class Name (FQCN) of the resource') | ||
->addOption('itemOperation', null, InputOption::VALUE_OPTIONAL, 'The item operation') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the InputOption::VALUE_OPTIONAL
should actually be InputOption::VALUE_REQUIRED
.
From the documentation:
InputOption::VALUE_REQUIRED
This value is required (e.g. --iterations=5 or -i5), the option itself is still optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing, don't we usually use dashes in option names, not camelCase?
e9436f2
to
91b530e
Compare
->addOption('itemOperation', null, InputOption::VALUE_REQUIRED, 'The item operation') | ||
->addOption('collectionOperation', null, InputOption::VALUE_REQUIRED, 'The collection operation') | ||
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The response format', (string) $this->formats[0]) | ||
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Use this option to set the type of output', 'input'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
The type of schema to generate (input or output)
45d4e9d
to
8aef8bf
Compare
8aef8bf
to
6ff741c
Compare
Thanks @jockos! |
Add a command to generate a JSON Schema for a resource.
Can be used for the whole resource or by operation