Skip to content

Commit da7b2fa

Browse files
committed
Remove likely obsolete examples, improve other
The `Link` header is now addressed in another PR. Make the first example a real header instead of an `X-`. Also provide a link to the Header Object for special cases that will be documented there in other PRs.
1 parent 4abf253 commit da7b2fa

File tree

1 file changed

+6
-40
lines changed

1 file changed

+6
-40
lines changed

src/oas.md

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,8 @@ For cookies, neither the `?` nor `&` delimiter is correct (see [Appendix D: Seri
10381038

10391039
Note that RFC6570 form expansion implementations will include either a leading `?` or `&` delimiter, depending on which type of form expansion is used, so in some scenarios it is necessary to strip off or change the leading delimiter.
10401040

1041+
See the [Header Object](#header-object) for special rules for showing examples of the `Set-Cookie` response header, which violates the normal rules for multiple header values.
1042+
10411043
The following section illustrates these rules.
10421044

10431045
##### Style Examples
@@ -2506,8 +2508,10 @@ Using `content` with a `text/plain` media type is RECOMMENDED for headers where
25062508
A simple header of type `integer`:
25072509

25082510
```yaml
2509-
X-Rate-Limit-Limit:
2510-
description: The number of allowed requests in the current period
2511+
Retry-After:
2512+
description: |
2513+
The number of seconds to wait before retrying the operation.
2514+
This Header Object does not allow the HTTP date format syntax.
25112515
schema:
25122516
type: integer
25132517
examples:
@@ -2528,44 +2532,6 @@ ETag:
25282532
pattern: ^"
25292533
```
25302534

2531-
A `Link` header that, if present, must include links with the standard relation types `self`, `first`, `prev`, `next`, and `last`, as might be used on a paginated collection:
2532-
2533-
```yaml
2534-
Link:
2535-
schema:
2536-
type: array
2537-
items:
2538-
type: string
2539-
allOf:
2540-
- contains:
2541-
pattern: rel="?first"?
2542-
- contains:
2543-
pattern: rel="?prev"?
2544-
- contains:
2545-
pattern: rel="?self"?
2546-
- contains:
2547-
pattern: rel="?next"?
2548-
- contains:
2549-
pattern: rel="?last"?
2550-
style: simple
2551-
# The ";" character and the URI delimiters are reserved
2552-
# but needs to be allowed as headers do not expect these
2553-
# to be percent-encoded.
2554-
allowReserved: true
2555-
examples:
2556-
CollectionLinks:
2557-
dataValue:
2558-
- https://example.com/foos?page=1; rel=first
2559-
- https://example.com/foos?page=4; rel=prev
2560-
- https://example.com/foos?page=5; rel=self
2561-
- https://example.com/foos?page=6; rel=next
2562-
- https://example.com/foos?page=10; rel=last
2563-
serializedValue: https://example.com/foos?page=1; rel=first, https://example.com/foos?page=4; rel=prev, https://example.com/foos?page=5; rel=self, https://example.com/foos?page=6; rel=next, https://example.com/foos?page=10; rel=last
2564-
```
2565-
2566-
Note that the `allOf` with `contains` combination allows the links to appear in any order.
2567-
If a fixed order is desired, then `prefixItems` could be used and the `allof` would not be necessary.
2568-
25692535
#### Tag Object
25702536

25712537
Adds metadata to a single tag that is used by the [Operation Object](#operation-object).

0 commit comments

Comments
 (0)