Skip to content

Commit

Permalink
Addressed some minor issues (#10)
Browse files Browse the repository at this point in the history
* Minor fixes

* Fixed README command reference
  • Loading branch information
DimanKuskov authored and sspat committed Jan 21, 2020
1 parent fe3641b commit 89e9769
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ or add

to the require section of your `composer.json` file.

Then add
```php
OnMoon\OpenApiServerBundle\OpenApiServerBundle::class => ['all' => true],
```
to array in `config/bundles.php`.

## Confirugation

You can configure the bundle by adding the following parameters to your `/config/services.xml`
Expand Down Expand Up @@ -64,7 +70,7 @@ second-api:
name_prefix: 'second_'
```
Generate the server code: `php bin/console app:openapi-generate-code`
Generate the server code: `php bin/console openapi:generate-code`

Now you can implement the service interfaces generated by the previous command and put the code that should
handle the api calls there.
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGenerator/Dto/PhpParserRootDtoFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function generateRootDto(
*/');

if (count($pathParameters)) {
$pathParametersDtoClassName = rtrim($className, 'Dto') . self::PATH_PARAMETERS_PREFIX;
$pathParametersDtoClassName = preg_replace('/Dto$/', '', $className) . self::PATH_PARAMETERS_PREFIX;
$pathParametersDtoFileName = $pathParametersDtoClassName . '.php';

$generatedClasses[] = $this->dtoFactory->generateParamDto(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function generateServiceInterface(
* This interface was automatically generated
* You should not change it manually as it will be overwritten
*/');
$methodBuilder = $this->factory->method($methodName);
$methodBuilder = $this->factory->method($methodName)->makePublic();

if ($summary !== null) {
$methodBuilder->setDocComment(sprintf('/** %s */', $summary));
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GenerateApiCodeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function __construct(
}

/** @var string */
protected static $defaultName = 'app:openapi-generate-code';
protected static $defaultName = 'openapi:generate-code';

protected function execute(InputInterface $input, OutputInterface $output) : ?int
{
Expand Down

0 comments on commit 89e9769

Please sign in to comment.