File tree 1 file changed +25
-1
lines changed
1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ composer require kaz29/cakephp-open-api-theme-plugin --dev
33
33
"cs-fix": "phpcbf --colors -p src/ tests/",
34
34
"stan": "phpstan analyse",
35
35
"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
37
37
},
38
38
```
39
39
@@ -45,6 +45,30 @@ Configure::write('Bake.theme', 'OpenApiTheme');
45
45
46
46
- Change Application.php as follows.
47
47
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
+
48
72
```
49
73
protected function bootstrapCli(): void
50
74
{
You can’t perform that action at this time.
0 commit comments