add command to generate json schema#2
Closed
jockos wants to merge 1 commit intodunglas:extract-schema-builderfrom
Closed
add command to generate json schema#2jockos wants to merge 1 commit intodunglas:extract-schema-builderfrom
jockos wants to merge 1 commit intodunglas:extract-schema-builderfrom
Conversation
6ad71d9 to
ef09409
Compare
dunglas
requested changes
Aug 19, 2019
| </service> | ||
| <service id="ApiPlatform\Core\JsonSchema\SchemaFactoryInterface" alias="api_platform.json_schema.schema_factory" /> | ||
|
|
||
| <service id="ApiPlatform\Core\JsonSchema\Command\JsonSchemaGenerateCommand" autoconfigure="true" autowire="true" /> |
Owner
There was a problem hiding this comment.
We don't use autowiring nor autoconfigure yet in API Platform
| * | ||
| * @author Jacques Lefebvre <jacques@les-tilleuls.coop> | ||
| */ | ||
| class JsonSchemaGenerateCommand extends Command |
Owner
There was a problem hiding this comment.
Suggested change
| class JsonSchemaGenerateCommand extends Command | |
| final class JsonSchemaGenerateCommand extends Command |
| { | ||
| $this | ||
| ->setName('api:json-schema:generate') | ||
| ->setDescription('Generates the json schema for a resource operation.') |
Owner
There was a problem hiding this comment.
Suggested change
| ->setDescription('Generates the json schema for a resource operation.') | |
| ->setDescription('Generates the JSON Schema for a resource operation.') |
| ->addArgument('resource', InputArgument::REQUIRED, 'The FQCN of the resource') | ||
| ->addOption('itemOperation', null, InputOption::VALUE_OPTIONAL, 'The item operation') | ||
| ->addOption('collectionOperation', null, InputOption::VALUE_OPTIONAL, 'The collection operation') | ||
| ->addOption('format', null, InputOption::VALUE_OPTIONAL, 'The desired output format', 'json') |
Owner
There was a problem hiding this comment.
Suggested change
| ->addOption('format', null, InputOption::VALUE_OPTIONAL, 'The desired output format', 'json') | |
| ->addOption('format', null, InputOption::VALUE_OPTIONAL, 'The format of the response', 'json') |
| $operationName = null; | ||
|
|
||
| if ($itemOperation && $collectionOperation) { | ||
| throw new InvalidOptionException('If specified, only one operation type can be asked'); |
Owner
There was a problem hiding this comment.
Suggested change
| throw new InvalidOptionException('If specified, only one operation type can be asked'); | |
| throw new InvalidOptionException('You can only use one of "--itemOperation" and "--collectionOperation" options at the same time.'); |
ef09409 to
a785929
Compare
a785929 to
2a89a13
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.