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: docs/book/v7/openapi/write-documentation.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ If you need help, take a look at the existing definitions found in Dotkernel API
30
30
31
31
Defines a `DELETE` HTTP request. It should specify at least the following parameters:
32
32
33
-
-`path`: the route to the resource (example: `/resource/{uuid}` - where `uuid` is a path parameter defined below)
33
+
-`path`: the route to the resource (example: `/resource/{id}` - where `id` is a path parameter defined below)
34
34
-`description`: verbose description of the endpoint's purpose
35
35
-`summary`: short description of the endpoint's purpose
36
36
-`security`: an array of security scheme(s) to be used—omit if the endpoint is not protected
@@ -42,7 +42,7 @@ Defines a `DELETE` HTTP request. It should specify at least the following parame
42
42
43
43
Defines a `GET` HTTP request. It should specify at least the following parameters:
44
44
45
-
-`path`: the route to a single or collection of resources (example: `/resource/{uuid}` for a single resource or `/resource` for a collection of resources)
45
+
-`path`: the route to a single or collection of resources (example: `/resource/{id}` for a single resource or `/resource` for a collection of resources)
46
46
-`description`: verbose description of the endpoint's purpose
47
47
-`summary`: short description of the endpoint's purpose
48
48
-`security`: an array of security scheme(s) to be used—omit if the endpoint is not protected
@@ -54,7 +54,7 @@ Defines a `GET` HTTP request. It should specify at least the following parameter
54
54
55
55
Defines a `PATCH` HTTP request. It should specify at least the following parameters:
56
56
57
-
-`path`: the route to the resource (example: `/resource/{uuid}` - where `uuid` is a path parameter defined below)
57
+
-`path`: the route to the resource (example: `/resource/{id}` - where `id` is a path parameter defined below)
58
58
-`description`: verbose description of the endpoint's purpose
59
59
-`summary`: short description of the endpoint's purpose
60
60
-`security`: an array of security scheme(s) to be used—omit if the endpoint is not protected
@@ -67,7 +67,7 @@ Defines a `PATCH` HTTP request. It should specify at least the following paramet
67
67
68
68
Defines a `POST` HTTP request. It should specify at least the following parameters:
69
69
70
-
-`path`: the route to the resource (example: `/resource/{uuid}` - where `uuid` is a path parameter defined below)
70
+
-`path`: the route to the resource (example: `/resource/{id}` - where `id` is a path parameter defined below)
71
71
-`description`: verbose description of the endpoint's purpose
72
72
-`summary`: short description of the endpoint's purpose
73
73
-`security`: an array of security scheme(s) to be used—omit if the endpoint is not protected
@@ -80,7 +80,7 @@ Defines a `POST` HTTP request. It should specify at least the following paramete
80
80
81
81
Defines a `PUT` HTTP request. It should specify at least the following parameters:
82
82
83
-
-`path`: the route to the resource (example: `/resource/{uuid}` - where `uuid` is a path parameter defined below)
83
+
-`path`: the route to the resource (example: `/resource/{id}` - where `id` is a path parameter defined below)
84
84
-`description`: verbose description of the endpoint's purpose
85
85
-`summary`: short description of the endpoint's purpose
86
86
-`security`: an array of security scheme(s) to be used—omit if the endpoint is not protected
Copy file name to clipboardExpand all lines: docs/book/v7/tutorials/api-evolution.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,20 @@ API evolution: Updating an API while keeping it compatible for existing consumer
4
4
5
5
## How it works
6
6
7
-
In Dotkernel API we can mark an entire endpoint or a single method as deprecated using attributes on handlers.
7
+
In Dotkernel API we can mark an endpoint as deprecated using attributes on handlers.
8
8
We use response headers to inform the consumers about the future changes by using two new headers:
9
9
10
10
-`Link` - it's a link to the official documentation pointing out the changes that will take place.
11
11
-`Sunset` - this header is a date, indicating when the deprecated resource will potentially become unresponsive.
12
12
13
-
**Both headers are independent, you can use them separately.**
13
+
**The above headers are independent, so you can use them separately.**
14
14
15
-
> Make sure you have the `DeprecationMiddleware:class`piped in your `pipeline` list.
15
+
> Make sure you have the `DeprecationMiddleware:class`added to your `pipeline` list.
16
16
> In our case it's `config/pipeline.php`.
17
17
18
-
## Marking an entire endpoint as deprecated
18
+
## Marking an endpoint as deprecated
19
19
20
-
When you want to mark an entire resource as deprecated, you have to use the `ResourceDeprecation` attribute.
20
+
When you want to mark a resource as deprecated, you have to use the `ResourceDeprecation` attribute.
21
21
22
22
```php
23
23
...
@@ -33,7 +33,7 @@ class HomeHandler implements RequestHandlerInterface
33
33
}
34
34
```
35
35
36
-
In the example above, the `ResourceDeprecation` attribute is attached to the class, marking the entire `/` (home) endpoint as deprecated starting from `2038-01-01`.
36
+
In the example above, the `ResourceDeprecation` attribute is attached to the class, marking the `/` (home) endpoint as deprecated starting from `2038-01-01`.
37
37
38
38
Running the following curl will print out the response headers where we can see the **Sunset** and **Link** headers.
39
39
@@ -62,4 +62,4 @@ Vary: Origin
62
62
63
63
> Deprecations can only be attached to handler classes that implement `RequestHandlerInterface`.
64
64
65
-
> The `rel` and `type` arguments are optional, they default to `sunset` and `text/html` if no value was provided and are `Link` related parts.
65
+
> The `rel` and `type` arguments are optional, they default to `sunset` and `text/html` if no value is provided and are `Link` related parts.
0 commit comments