|
1 | 1 | # Migrating
|
2 |
| -- Version requirement: PHP 7.2 and Laravel 5.7 |
| 2 | +Note: This isn't meant to be an exhaustive guide to the changes in v4. Please see the changelog for more details (and full list of new features). |
3 | 3 |
|
4 |
| -- Rename your old config file. Publish the new config file and copy over any changes you made to the old one. |
| 4 | +## Requirements |
| 5 | +- PHP version: 7.2+ |
| 6 | +- Laravel/Lumen version: 5.7+ |
5 | 7 |
|
6 |
| -- Rename your old vendor view (if published). Publish the new vendor view and copy over any changes you made to the old one. |
| 8 | +## Configuration |
| 9 | +- Rename your old config file (for instance to `apidoc.old.php`). Publish the new config file via `php artisan vendor:publish --provider="Mpociot\ApiDoc\ApiDocGeneratorServiceProvider" --tag=apidoc-config`. Then copy over any changes you've made in the old one and delete it when you're done. |
7 | 10 |
|
8 |
| -- Migrate `bindings` to `@urlParam` |
| 11 | +- Remove the `bindings` section. It has been superseded by the `@urlParam` annotation, which works similarly to the existing `@queryParam` annotation. See [the docs](documenting.html#specifying-request-parameters) |
9 | 12 |
|
10 |
| -- Remove `response_calls.bindings` |
| 13 | +- Remove the `response_calls.bindings` section. Use the `Example: ` feature of `@urlParam` to specify the value you want to be used in response calls. |
11 | 14 |
|
12 |
| -- Rename `query` and `body` in `response_calls` config to `queryParams` and `bodyParams` |
| 15 | +- Rename the `query` and `body` sections in `response_calls` section to `queryParams` and `bodyParams` |
13 | 16 |
|
14 |
| -- Move any `apply.response_calls.headers` to `apply.headers` |
| 17 | +- Remove the `apply.response_calls.headers`. Move any headers you had there to `apply.headers` |
15 | 18 |
|
16 |
| -- Move any prepend/append files to new location (resources/docs/source) |
| 19 | +## Assets |
| 20 | +- If you've published the vendor views, rename them (for instance to `route.old.blade.php`). Publish the new views via `php artisan vendor:publish --provider="Mpociot\ApiDoc\ApiDocGeneratorServiceProvider" --tag=apidoc-views`. Compare the two views and reconcile your changes, then delete the old views. Some of the data being passed to the views (the `$route` object) has changed in either name or format, so things will likely break if you use old views. |
| 21 | +The major change here is the introduction of the `urlParameters` section and the collapsing of route `title`, `description`, `groupName`, `groupDescription`, and authentication status (`authenticated` into a `metadata` section. |
17 | 22 |
|
18 |
| -- Verify that any custom strategies match the new signatures |
| 23 | +- The location of the source files for the generated docs has changed. Move any prepend/append files you've created from `public/docs/source` to the new location (`resources/docs/source`) |
19 | 24 |
|
20 |
| -- Modify any custom language views to match new parameters (`metadata`) |
| 25 | +## API |
| 26 | +- Verify that any custom strategies you've written match the new signatures. See [the docs](plugins.html#strategies). Also note the order of execution and the new stages present. |
21 | 27 |
|
22 |
| -- See changelog for details |
| 28 | +## Other new features (highlights) |
| 29 | +- [Non-static docs/docs with authentication](config.html#type) |
| 30 | +- [`@apiResource` for Eloquent API resources](documenting.html#apiresource-apiresourcecollection-and-apiresourcemodel) |
| 31 | +- You can now mix and match response strategies and status codes as you like. |
0 commit comments