Skip to content

Commit 25e85dc

Browse files
committed
Add a clear overview of summary vs description
1 parent 7aaeaf9 commit 25e85dc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

specification/docs.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ Besides machine-readable descriptions, an OpenAPI Description (OAD) can also inc
1111

1212
This page shows how to take full advantage of special documentation capabilities in OpenAPI like markdown syntax or example objects.
1313

14+
## Summary vs Description
15+
16+
Many objects support both `summary` and `description` fields, and this is especially useful where documentation or other tools might show items in either list or detail view.
17+
18+
- `summary` is used for list view, and should be kept short. A single-sentence summary works well.
19+
- `description` is shown when the item is being viewed in detail. The descriptions support markup and give you space to include as much information for your users as you want to. Don't be afraid to add paragraph breaks, links, or even bullet lists in these fields.
20+
1421
## The Description Field
1522

1623
Almost every object in the OpenAPI Specification accepts a `description` field which can provide additional information for developers, beyond what can be automatically generated from the API descriptions.

specification/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ The following pages introduce the syntax and structure of an OpenAPI Description
1717
- [Content of Message Bodies](content): `content` and `schema`.
1818
- [Parameters and Payload of an Operation](parameters): `parameters` and `requestBody`.
1919
- [Reusing Descriptions](components): `components` and `$ref`.
20-
- [Providing Documentation and Examples](docs): `description` and `example`/`examples`.
20+
- [Providing Documentation and Examples](docs): `summary`, `description` and `example`/`examples`.
2121
- [API Servers](servers): `servers`.

0 commit comments

Comments
 (0)