These are the snippets of swagger used in the blog post 3 Best Practices for API Development with Swagger (Open API).
There is an example of using swagger in this way included in blueoak-server.
get: | |
summary: User Profile | |
description: | | |
The User Profile endpoint returns information about the Uber user that has authorized with the application. | |
tags: | |
- User | |
responses: | |
200: | |
description: Profile information for a user | |
schema: | |
$ref: '../definitions/Profile.yaml' | |
default: | |
description: Unexpected error | |
schema: | |
$ref: '../definitions/Error.yaml' |
{ | |
"name": "address", | |
"in": "query", | |
"required": false, | |
"type": "string", | |
"description": "A string representing the address to be geocoded and used in a query.\nThis string should consist of a combination of components such as:\nstreet address, city, state, and zip code.\n\n**Examples**:\n\n1. `address=123 main st, fl`\n2. `address=33133`\n3. `address=401 Channelside Dr, Tampa, FL 33602`\n" | |
} |
name: address | |
in: query | |
required: false | |
type: string | |
description: | | |
A string representing the address to be geocoded and used in a query. | |
This string should consist of a combination of components such as: | |
street address, city, state, and zip code. | |
**Examples**: | |
1. `address=123 main st, fl` | |
2. `address=33133` | |
3. `address=401 Channelside Dr, Tampa, FL 33602` |
These are the snippets of swagger used in the blog post 3 Best Practices for API Development with Swagger (Open API).
There is an example of using swagger in this way included in blueoak-server.