Skip to content

Commit 18fdcd7

Browse files
committed
Update migration guide
1 parent f57df88 commit 18fdcd7

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $app->configure('apidoc');
4444
```
4545

4646
## Documentation
47-
Check out the documentation at [ReadTheDocs](http://laravel-apidoc-generator.rftd.io/en/v4).
47+
Check out the documentation at [ReadTheDocs](http://laravel-apidoc-generator.rtfd.io/en/v4). Don't forget to check out the [migration guide](https://laravel-apidoc-generator.rtfd.io/en/v4/migrating.html) if you're coming from v3 to v4.
4848

4949
### License
5050

docs/migrating.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
# 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).
33

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+
57

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.
710

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)
912

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.
1114

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`
1316

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`
1518

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.
1722

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`)
1924

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.
2127

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

Comments
 (0)