Skip to content

Commit da9e710

Browse files
authored
Merge pull request #11 from kaz29/fix/readme
fix readme
2 parents 3e46c05 + ed5dbe3 commit da9e710

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ composer require kaz29/cakephp-open-api-theme-plugin --dev
3333
"cs-fix": "phpcbf --colors -p src/ tests/",
3434
"stan": "phpstan analyse",
3535
"test": "phpunit --colors=always",
36-
"build:swagger" : "build-swagger-json" // <-- add this line
36+
"build:openapi": "openapi -b ./vendor/autoload.php --output /srv/docs/openapi.yml ./src" // <-- add this line
3737
},
3838
```
3939
@@ -45,6 +45,30 @@ Configure::write('Bake.theme', 'OpenApiTheme');
4545
4646
- Change Application.php as follows.
4747
48+
```
49+
#[OA\Info(title: '**Your Application name**', version: '**Your application version**')]
50+
#[OA\Server(description: '**Environment name**', url: '**URL**')]
51+
#[OA\Schema(
52+
schema: 'ValidationErrorResponse',
53+
title: 'Validation error response',
54+
required: ['message', 'errors'],
55+
properties: [
56+
new OA\Property(
57+
property: 'message',
58+
type: 'string',
59+
description: 'Error message',
60+
),
61+
new OA\Property(
62+
property: 'errors',
63+
type: 'object',
64+
description: 'Error details',
65+
),
66+
]
67+
)]
68+
class Application extends BaseApplication
69+
...
70+
```
71+
4872
```
4973
protected function bootstrapCli(): void
5074
{

0 commit comments

Comments
 (0)