You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Configure documentation saving, using one of the next way:
38
+
1. Configure documentation saving using one of the next ways:
37
39
- Add `SwaggerExtension` to the `<extensions>` block of your `phpunit.xml`. Please note that this way will be removed after updating PHPUnit up to 10 version (https://github.com/sebastianbergmann/phpunit/issues/4676)
38
40
```
39
41
<extensions>
@@ -48,9 +50,9 @@ to display the generated documentation for a config.
48
50
- Call `php artisan swagger:push-documentation` console command after the `tests` stage in your CI/CD configuration
49
51
50
52
## Usages
51
-
For correct working of plugin you have to dispose all the validation rules in the rules() method of class YourRequest,
53
+
For correct working of plugin you have to dispose all the validation rules in the rules() method of `YourRequest` class,
52
54
which must be connected to the controller via DependencyInjection. In annotation of custom request you can specify
53
-
summary and description of this request. Plugin will take validation rules from your request and use it as description
55
+
summary and description. Plugin will take validation rules from your request and use it as description
54
56
of input parameter.
55
57
56
58
### Example
@@ -104,13 +106,13 @@ to display the generated documentation for a config.
104
106
105
107
-**@summary** - short description of request
106
108
-**@description** - Implementation Notes
107
-
-**@_204** - Custom description of code of response. You can specify any code as you want.
108
-
-**@some_field** - Description of this field from the rules method
109
+
-**@_204** - Custom description of response code. You can specify any code as you want.
110
+
-**@some_field** - Description of the field from the rules method
109
111
110
112
If you do not create a class Request, the summary, Implementation Notes and parameters will be empty.
111
113
Plugin will collect codes and examples of responses only.
112
114
113
-
If you do not create annotations to request summary will generate automatically from Name of Request.
115
+
If you do not create annotations to request summary it will generate automatically from Name of Request.
114
116
For example request **UpdateUserDataRequest** will have summary **Update user data request**.
115
117
116
118
If you do not create annotations for descriptions of codes it will be generated automatically the following priorities:
@@ -119,8 +121,15 @@ to display the generated documentation for a config.
119
121
3. Descriptions from **Symfony\Component\HttpFoundation\Response::$statusTexts**
120
122
121
123
Note about configs:
122
-
-*auto-doc.route* - it's a route where will be located generated documentation
123
-
-*auto-doc.basePath* - it's a route where located root of your api
124
+
-*auto-doc.route* - it's a route for generated documentation
125
+
-*auto-doc.basePath* - it's a root of your api root
124
126
125
127
Also you can specify way to collect documentation by creating your custom data collector class.
128
+
## Contributing
129
+
130
+
Thank you for considering contributing to Laravel Swagger plugin! The contribution guide can be found in the [Contributing guide](CONTRIBUTING.md).
131
+
132
+
## License
133
+
134
+
Laravel Swagger plugin is open-sourced software licensed under the [MIT license](LICENSE).
0 commit comments