Skip to content

Commit 472b042

Browse files
committed
Update migration guide
1 parent cb9c4a6 commit 472b042

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/migrating-v2.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Scribe 2: What's new, and how to migrate
22

3-
Scribe 2 comes with a bunch of changes focused on making the documentation process easier and the output nicer. There aren't many "shiny" changes, mostly improvements to what works. For the most part, you won't need to do much work. We've marked required changes in the list below with a "Migration Required" label.
3+
Scribe 2 comes with a bunch of changes focused on making the documentation process easier and the output nicer. There aren't many "shiny" changes, mostly improvements to what works. We've marked required changes in the list below with a "Migration Required" label.
44

55
This is also a release announcement for Scribe for JS! [Version 1 has now been released]()!🎉
66

@@ -9,14 +9,18 @@ This is also a release announcement for Scribe for JS! [Version 1 has now been r
99
:local:
1010
```
1111

12+
Start by upgrading the package version in your composer.json to `^2.0` and running `composer update knuckleswtf/scribe`. Next, make a copy of your config file before publishing the new one (`php artisan vendor:publish --tag=scribe-config`). Then, when you're done applying the changes described here, copy in any custom config for your setup.
13+
1214
## Changes in the output
1315

1416
### "Try It Out": interactive documentation with (probably) zero config ⚡💥
1517
Big news: Your docs will now include a "Try t Out" button that allows users to test out an endpoint, right from their browser.
1618

1719
![](./images/tryitout-button.jpg)
1820

19-
To enable this, set `interactive` to true. Don't forget to enable CORS headers in your API! Here's the [full doc](./generating-documentation.html#configuring-interactive-documentation).
21+
To enable this, set `interactive` to true. Don't forget to enable CORS headers for your domain in your API! Here's the [full doc](./generating-documentation.html#configuring-interactive-documentation).
22+
23+
**Note**: If you've published the views previously, you may need to re- publish them to get the included "Try It Out" functionality.
2024

2125
### Object fields are now represented better in the docs
2226
Object fields are now wrapped in a `<details>` element, so you can expand the dropdown to see fields within an object. This way, it's clearer that these are subfields within a parent.
@@ -27,7 +31,7 @@ Object fields are now wrapped in a `<details>` element, so you can expand the dr
2731
## Changes to the config file
2832

2933
### Specify the default auth status of endpoints with `auth.default`
30-
Previously, if you had an API with all endpoints authenticated, you had to set `auth.enabled` to true, AND use `@authenticated` on every endpoint. Pain in the ass. Now you can mark all endpoints as authenticated, by setting `auth.default` to true (don't forget to set `uaht.enabled` to true as well). You can also remove auth from specific endpoints with `@unauthenticated`.
34+
Previously, if you had an API with all endpoints authenticated, you had to set `auth.enabled` to true AND use `@authenticated` on every endpoint. Pain in the ass. Now you can mark all endpoints as authenticated, by setting `auth.default` to true (don't forget to set `auth.enabled` to true as well). You can also remove auth from specific endpoints with `@unauthenticated`.
3135

3236
### [Migration Required] `description` replaces `postman.description`
3337
In 1.6.0, we added a `description` config item, where you can add a description of your API. This field is used as the `info.description` field in the Postman collection and OpenAPI spec, and as the first paragraph under the "Introduction" section on the docs webpage, before the `intro_text`. We've now removed `postman.description`.
@@ -90,17 +94,17 @@ Previously, you couldn't specify types for URL and query parameters. The idea wa
9094
- In custom strategies: Update any custom strategies you've written so they return a `type` field for each URL and query parameter
9195

9296
## Other changes
97+
### `add_routes`: Postman collection route changed
98+
When you use `laravel` type docs and have `add_routes` set to `true`, you get three routes added to your Laravel app: one for the webpage, one for the Postman collection and one for the OpenAPI spec. The route for the Postman collection was previously `/docs.json`, but has now been renamed to `/docs.postman`, to bring it in line with the OpenAPI route, which is `/docs.openapi`.
99+
93100
### `@responseFile` supports other directories
94101
You can now specify a file located anywhere on your machine with `@responseFile`. The file path can either be an absolute path, a path relative to your project root, or a path relative to the Laravel storage directory.
95102

96-
### `add_routes`: Postman collection route renamed
97-
When you use `laravel` type docs and have `add_routes` set to `true`, you get three routes added to your Laravel app: one for the webpage, one for the Postman collection and one for the OpenAPI spec. The route for the Postman collection was previously named `scribe.json`, but has now been renamed to `scribe.postman`, to bring it in line with the OpenAPI route, which is named `scribe.openapi`.
98-
99103
### Postman base URL now uses Postman variables
100-
Postman collection base URL now uses a `{{baseUrl}}` variable, so you can change the base URL for all endpoints in your collection easier.
104+
Postman collection base URL now uses a `{{baseUrl}}` Postman variable, so you can easily change the base URL for all endpoints in your collection from within Postman.
101105

102106
### [Migration Required] Plugin API changes: include 'name' in parameter details
103-
This only applies if you have custom strategies. All strategies that return URL, query or body parameters or response fields must now include the name of the field as a `name` field in the returned array. This means that the parameter name is going to be mentioned twice in the result from the strategy:
107+
This only applies if you have created any custom strategies. All strategies that return URL, query or body parameters or response fields must now include the name of the field as a `name` field in the returned array. This means that the parameter name is going to be mentioned twice in the result from the strategy:
104108

105109
```php
106110
return [

0 commit comments

Comments
 (0)