Skip to content

Add a clear overview of summary vs description #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions specification/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Besides machine-readable descriptions, an OpenAPI Description (OAD) can also inc

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

## Summary vs Description

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.

- `summary` is used for list view, and should be kept short. A single-sentence summary works well.
- `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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be tempted to make this more determistic from the perspective of what Markdown supports i.e.

"CommonMark supports formatted text, so their is an opportunity to provide extensive, explanatory text in the description property that can be rendered by tools that support OpenAPI."

And then break into "do not..."

Doing this sets the constraints of the language, before providing advice on best practice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to edit, but we're already going on a lot about the actual markdown aspect in this article. I am mostly trying to explain how the fields are used, since that information wasn't clear.


## The Description Field

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.
Expand Down
2 changes: 1 addition & 1 deletion specification/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ The following pages introduce the syntax and structure of an OpenAPI Description
- [Content of Message Bodies](content): `content` and `schema`.
- [Parameters and Payload of an Operation](parameters): `parameters` and `requestBody`.
- [Reusing Descriptions](components): `components` and `$ref`.
- [Providing Documentation and Examples](docs): `description` and `example`/`examples`.
- [Providing Documentation and Examples](docs): `summary`, `description` and `example`/`examples`.
- [API Servers](servers): `servers`.