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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
16
16
## [4.0.0]
17
17
### Added
18
+
- Support for Eloquent API resources (https://github.com/mpociot/laravel-apidoc-generator/pull/601)
18
19
-`bindings` replaced by `@urlParam` annotation (https://github.com/mpociot/laravel-apidoc-generator/pull/599)
19
20
- Better support for arrays and objects in bodyParams (https://github.com/mpociot/laravel-apidoc-generator/pull/597)
20
21
22
+
### Modified
23
+
- Made ResponseCalls strategy only execute if no successful responses exist. (https://github.com/mpociot/laravel-apidoc-generator/pull/605)
24
+
- Hide null responses in examples. (https://github.com/mpociot/laravel-apidoc-generator/pull/605)
25
+
- Made `responses` stage additive (https://github.com/mpociot/laravel-apidoc-generator/pull/605)
26
+
- Renamed `query` and `body` in `response_calls` config to `queryParams` and `bodyParams` (https://github.com/mpociot/laravel-apidoc-generator/pull/603)
27
+
28
+
### Removed
29
+
- Removed `apply.response_calls.headers` in favour of `apply.headers` (https://github.com/mpociot/laravel-apidoc-generator/pull/603)
30
+
- Removed bindings in response_calls (https://github.com/mpociot/laravel-apidoc-generator/pull/599)
31
+
21
32
## [3.17.1] - Thursday, 12 September 2019
22
33
### Fixed
23
34
- ResponseCalls: Call Lumen application correctly since it does not use HttpKernel (https://github.com/mpociot/laravel-apidoc-generator/pull/585)
Copy file name to clipboardExpand all lines: docs/config.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,19 @@
2
2
3
3
Before you can generate your documentation, you'll need to configure a few things in your `config/apidoc.php`. If you aren't sure what an option does, it's best to leave it set to the default. If you don't have this config file, see the [installation instructions](index.html#installation).
4
4
5
-
## `output`
6
-
This is the file path where the generated documentation will be written to. Note that the documentation is generated as static HTML and CSS assets, so the route is accessed directly, and not via the Laravel routing mechanism. This path should be relative to the root of your application. Default: **public/docs**
5
+
## `type`
6
+
This is the type of documentation output to generate.
7
+
-`static` will generate a static HTMl page in the `public/docs` folder, so anyone can visit your documentation page by going to {yourapp.domain}/docs.
8
+
-`laravel` will generate the documentation as a Blade view within the `resources/views/apidoc` folder, so you can add routing and authentication.
9
+
10
+
If you're using `laravel` type, you can call `\Mpociot\ApiDoc\ApiDoc::routes()` from your routes file (usually `routes/web.php`). This method will create a `/doc` route for your documentation, along with a `/doc.json` variant that will return the Postman collection, if you have that enabled. This method returns the route, so you can call additional methods to customise it (by adding middleware, for instance). You can also pass in the path you'd like to use instead.
> Note: There is currently a known issue with using `/docs` as the path for `laravel` docs. You should not use it, as it conflicts with the folder structure in the `public` folder and may confuse the webserver.
16
+
17
+
You may, of course, set up your own routing instead of using the `routes()` helper.
7
18
8
19
## `router`
9
20
The router to use when processing your routes (can be Laravel or Dingo. Defaults to **Laravel**)
@@ -13,6 +24,8 @@ The base URL to be used in examples and the Postman collection. By default, this
13
24
14
25
## `postman`
15
26
This package can automatically generate a Postman collection for your routes, along with the documentation. This section is where you can configure (or disable) that.
27
+
- For `static` docs (see [type](#type)), the collection will be created in `public/docs/collection.json`, so it can be accessed by visiting {yourapp.domain}/docs/colllection.json.
28
+
- For `laravel` docs, the collection will be generated to `storage/app/apidoc/collection.json`. The `ApiDoc::routes()` helper will add a `/docs.json` endpoint to fetch it..
16
29
17
30
### `enabled`
18
31
Whether or not to generate a Postman API collection. Default: **true**
@@ -124,9 +124,9 @@ You are also provided with the instance pproperty `stage`, which is set to the n
124
124
## Utilities
125
125
You have access to a number of tools when developing strategies. They include:
126
126
127
-
- The `RouteDocBlocker` class (in the `\Mpociot\ApiDoc\Tools` namespace) has a single public static method, `getDocBlocksFromRoute(Route $route)`. It allows you to retrieve the docblocks for a given route. It returns an array of with two keys: `method` and `class` containing the docblocks for the method and controller handling the route respectively. Both are instances of `\Mpociot\Reflection\DocBlock`.
127
+
- The `RouteDocBlocker` class (in the `\Mpociot\ApiDoc\Extracting` namespace) has a single public static method, `getDocBlocksFromRoute(Route $route)`. It allows you to retrieve the docblocks for a given route. It returns an array of with two keys: `method` and `class` containing the docblocks for the method and controller handling the route respectively. Both are instances of `\Mpociot\Reflection\DocBlock`.
128
128
129
-
- The `ParamsHelper` trait (in the `\Mpociot\ApiDoc\Tools` namespace) can be included in your strategies. It contains a number of useful methods for working with parameters, including type casting and generating dummy values.
129
+
- The `ParamsHelper` trait (in the `\Mpociot\ApiDoc\Extracting` namespace) can be included in your strategies. It contains a number of useful methods for working with parameters, including type casting and generating dummy values.
130
130
131
131
## API
132
132
Each strategy class must implement the __invoke method with the parameters as described above. This method must return the needed data for the intended stage, or `null` to indicate failure.
0 commit comments