16 changed files with 472 additions and 357 deletions
@ -1,104 +0,0 @@ |
|||
swagger: '2.0' |
|||
info: |
|||
title: 'Beer Catalog API' |
|||
description: 'An API for querying beer catalog of Acme Inc.' |
|||
contact: |
|||
name: 'Laurent Broudoux' |
|||
url: 'http://github.com/lbroudoux' |
|||
email: laurent.broudoux@gmail.com |
|||
license: |
|||
name: 'MIT License' |
|||
url: 'https://opensource.org/licenses/MIT' |
|||
version: '1.0' |
|||
basePath: /api |
|||
paths: |
|||
'/beer/{name}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beer having name' |
|||
description: 'Get beer having name' |
|||
operationId: GetBeer |
|||
responses: |
|||
'200': |
|||
description: 'Beer having requested name' |
|||
schema: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: name |
|||
in: path |
|||
description: 'Name of beer to retrieve' |
|||
required: true |
|||
type: string |
|||
'/beer/findByStatus/{status}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beers having status' |
|||
description: 'Get beers having status' |
|||
operationId: FindBeersByStatus |
|||
responses: |
|||
'200': |
|||
description: 'List of beers having requested status' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: status |
|||
in: path |
|||
description: 'Status of beers to retrieve' |
|||
required: true |
|||
type: string |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
/beer: |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'List beers within catalog' |
|||
description: 'List beers within catalog' |
|||
operationId: ListBeers |
|||
responses: |
|||
'200': |
|||
description: 'Array of beers' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
tags: |
|||
- name: beer |
|||
description: 'Beer resource' |
|||
definitions: |
|||
Beer: |
|||
properties: |
|||
name: |
|||
description: 'Name of Beer' |
|||
type: string |
|||
country: |
|||
description: 'Origin country of Beer' |
|||
type: string |
|||
type: |
|||
description: 'Type of Beer' |
|||
type: string |
|||
rating: |
|||
description: 'Rating from customers' |
|||
type: number |
|||
status: |
|||
description: 'Stock status' |
|||
type: string |
|||
securityDefinitions: |
|||
apikey: |
|||
type: apiKey |
|||
description: Use a 3scale API Key |
|||
name: api-key |
|||
in: header |
|||
security: |
|||
- apikey: [] |
|||
@ -0,0 +1 @@ |
|||
../lab-instructions/static/design/exercise/beer-catalog-1.0.yaml |
|||
@ -1,107 +0,0 @@ |
|||
swagger: '2.0' |
|||
info: |
|||
title: 'Beer Catalog API' |
|||
description: 'An API for querying beer catalog of Acme Inc.' |
|||
contact: |
|||
name: 'Laurent Broudoux' |
|||
url: 'http://github.com/lbroudoux' |
|||
email: laurent.broudoux@gmail.com |
|||
license: |
|||
name: 'MIT License' |
|||
url: 'https://opensource.org/licenses/MIT' |
|||
version: '2.0' |
|||
basePath: /api |
|||
paths: |
|||
'/beer/{name}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beer having name' |
|||
description: 'Get beer having name' |
|||
operationId: GetBeer |
|||
responses: |
|||
'200': |
|||
description: 'Beer having requested name' |
|||
schema: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: name |
|||
in: path |
|||
description: 'Name of beer to retrieve' |
|||
required: true |
|||
type: string |
|||
'/beer/findByStatus/{status}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beers having status' |
|||
description: 'Get beers having status' |
|||
operationId: FindBeersByStatus |
|||
responses: |
|||
'200': |
|||
description: 'List of beers having requested status' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: status |
|||
in: path |
|||
description: 'Status of beers to retrieve' |
|||
required: true |
|||
type: string |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
/beer: |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'List beers within catalog' |
|||
description: 'List beers within catalog' |
|||
operationId: ListBeers |
|||
responses: |
|||
'200': |
|||
description: 'Array of beers' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
tags: |
|||
- name: beer |
|||
description: 'Beer resource' |
|||
definitions: |
|||
Beer: |
|||
properties: |
|||
name: |
|||
description: 'Name of Beer' |
|||
type: string |
|||
country: |
|||
description: 'Origin country of Beer' |
|||
type: string |
|||
type: |
|||
description: 'Type of Beer' |
|||
type: string |
|||
rating: |
|||
description: 'Rating from customers' |
|||
type: number |
|||
status: |
|||
description: 'Stock status' |
|||
type: string |
|||
securityDefinitions: |
|||
oidc: |
|||
type: oauth2 |
|||
flow: accessCode |
|||
authorizationUrl: https://filled-later.dummy/auth |
|||
tokenUrl: https://filled-later.dummy/token |
|||
scopes: |
|||
openid: Get an OpenID Connect token |
|||
security: |
|||
- oidc: |
|||
- openid |
|||
@ -0,0 +1 @@ |
|||
../lab-instructions/static/secure/exercise/beer-catalog-2.0.yaml |
|||
@ -0,0 +1,34 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Help ACME manage the growing demand on their Brewery API! |
|||
|
|||
- Open your **3scale Developer Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_developer_portal_url >}} |
|||
``` |
|||
|
|||
- Make sure you are logged in |
|||
- Click **Applications** |
|||
- Click on your application (the one that uses the **Beer Catalog API (PROD, v1.0)** service) |
|||
- Next to the plan name, click **Review/Change** |
|||
- Select the **gold** plan |
|||
- Click **Request Plan change** |
|||
|
|||
*The administrators has been notified of your request. Since we do not have access to the administrator's mailbox, we will complete the rest of the process by hand.* |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}}/login |
|||
``` |
|||
|
|||
- Go to **Beer Catalog API (PROD, v1.0)** (top dropdown list) |
|||
- Go to **Applications** > **Listing** |
|||
- Click on your application |
|||
- In the **Change Plan** box, select **gold** and click **Change Plan** |
|||
|
|||
To complete your understanding, from the **3scale Developer Portal** pretend you have special needs and request a special treatment (such as higher limits). From the **3scale Admin Portal** fulfill this request. |
|||
@ -0,0 +1,22 @@ |
|||
--- |
|||
title: "Exercise: Check" |
|||
weight: 3 |
|||
--- |
|||
|
|||
## Check that the first implementation of the ACME Brewery API is deployed! |
|||
|
|||
In the previous exercise, you automated the Continuous Integration and Continuous Deployment (CI/CD) of the ACME Brewery API. In this exercise, you will try to use the ACME Brewery API as one of the ACME customers would do. |
|||
|
|||
- Open your **3scale Developer Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_developer_portal_url >}}/login |
|||
``` |
|||
|
|||
- Login with the default test account (login = `john`, password = `123456`) |
|||
- Go to **Applications** and grab the API Key of the "Beer Catalog API (**PROD**, v1.0)" |
|||
- Go to **Documentation** > **Beer Catalog API (PROD, v1.0)** |
|||
- Unfold **/beer** |
|||
- Click the red exclamation mark on the right side |
|||
- Paste the API Key and click **Authorize** |
|||
- Click the **Try it out!** button |
|||
@ -0,0 +1,55 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Help ACME customers to better develop apps based on the Brewery API! |
|||
|
|||
ACME customers can now discover the Brewery API, on-board and quickly get access to the API. They will start developing client applications based on this API and we want to make sure we provide enough resources for developers to get the most out of the Brewery API. |
|||
|
|||
In this exercise, we will create a new Page in the Developer Portal, describing how to use an API secured by OpenID Connect. |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}} |
|||
``` |
|||
|
|||
- Go to **Audience** (top dropdown list) > **Developer Portal** > **Content** |
|||
- Click **New Page** in the top right corner |
|||
- Set the **Title** to `Best Practices` |
|||
- Set the **Path** to `/docs/best-practices` |
|||
- Leave the **Layout** to `Main Layout` |
|||
- Unfold the **Advanced Options** and set the **Handler** to `Markdown` |
|||
- In the content pane, write something similar to: |
|||
|
|||
```md |
|||
# Best Practices |
|||
|
|||
## How to use OpenID Connect |
|||
|
|||
To use OpenID Connect, you will have to first get a token from the Authorization Server and then use it to query our API. |
|||
|
|||
Bla bla bla. To be continued... |
|||
``` |
|||
|
|||
- Click **Create Page** |
|||
- Click **Publish** |
|||
|
|||
- In the left pane, click the **Documentation** page |
|||
- In the content pane, just below `<h1>API Catalog</h1>` add this line: |
|||
|
|||
```md |
|||
<p><a href="/docs/best-practices">Best Practices</a></p> |
|||
``` |
|||
|
|||
- Click **Save**, then **Publish** |
|||
|
|||
- Open your **3scale Developer Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_developer_portal_url >}} |
|||
``` |
|||
|
|||
- Click on **Documentation** |
|||
- Click on **Best practices** |
|||
@ -0,0 +1,45 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Help ACME customers to discover the Brewery API! |
|||
|
|||
Since the beginning of this workshop, ACME has released two versions of its API. It's now time to promote their discovery and usage by ACME customers! |
|||
|
|||
We will first start by defining the developer on-boarding workflow. |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}}/login |
|||
``` |
|||
|
|||
- Go to **Beer Catalog API (PROD, v1.0)** (top dropdown list) |
|||
- Go to **Applications** > **Application Plans** |
|||
- In the **Default Plan** drop down list, select `silver` |
|||
- Below, in the list of all service plans, click **Publish** for each application plan (`silver` and `gold`) |
|||
- Go to **Integration** > **Settings** |
|||
- In the **Default Service Plan** section, in the **Default Plan** drop down list, select `Default` |
|||
- Go to **Audience** (top dropdown list) > **Developer Portal** > **Content** |
|||
- Review the **Homepage**. This will be the first page your developers will see. |
|||
|
|||
You can continue by testing this on-boarding workflow as a normal developer would do. |
|||
|
|||
- Open your **3scale Developer Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_developer_portal_url >}} |
|||
``` |
|||
|
|||
- Click the **Logout** button on the top right corner if you are already logged in |
|||
- Click **Documentation**, pretend you want to subscribe to the **Beer Catalog API (PROD, v1.0)** service |
|||
- Click **Sign-in** |
|||
- At the bottom of the sign-in form, click **Sign-up** |
|||
- Fill in the form with your corporate or personal details |
|||
- Click **Sign-up** |
|||
- Check your mailbox and click on the activation link |
|||
- Login with your chosen credentials |
|||
- Go to **Applications** |
|||
|
|||
*A client application for the "Beer Catalog API (PROD, v1.0)" service should have been created.* |
|||
@ -0,0 +1,24 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Manage the ACME Brewery API! |
|||
|
|||
Since the beginning of this workshop, ACME has released two versions of its API. Let's manage them! |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}}/login |
|||
``` |
|||
|
|||
- Review the existing services and explain **how APIs are versioned** |
|||
- If ACME needs to release a maintenance version "1.1" of its API, **how would it materialize in the 3scale Admin Portal**? |
|||
- Create two application plans for the **Beer Catalog API (PROD, v1.0)**: `silver` and `gold`. |
|||
- Add rate limits to the `silver` application plan |
|||
- Create a new test application consuming the `silver` application plan |
|||
- Ensure the rate limits are applied |
|||
- Pretend there is a security issue and suspend the application |
|||
|
|||
To complete your understanding, explain **how you would declare the v1.0 as deprecated** and **how you would help the consumer move from the deprecated v1.1 to v2.0**. |
|||
@ -0,0 +1,21 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Help ACME drive revenue from its Brewery API! |
|||
|
|||
ACME Customers are using the Brewery API to discover the Beer Catalog and the inventory. With an ever growing demand, ACME wants to drive new revenue from the usage of its API. Help them setup API Monetization in 3scale! |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}}/login |
|||
``` |
|||
|
|||
- Go to **Beer Catalog API (PROD, v1.0)** (top dropdown list) |
|||
- Click **Applications**, **Application Plans** |
|||
- Edit the **silver** plan to add a fixed price (1$ per call) for the **Get beer having name** method |
|||
- Click **Update Application Plan** |
|||
- Edit the **gold** plan to add a variable price for the **Get beer having name** method: 1$ for 1 to 100 calls, then 0.5$ up to 1000 calls, free afterwards. |
|||
- Click **Update Application Plan** |
|||
@ -0,0 +1,22 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Help ACME get feedback on the Brewery API! |
|||
|
|||
Since the beginning of this workshop, ACME released two versions of its API, customers are started using them and it is now time to think about the next iteration. In this exercise, you will help ACME set a feedback loop to know what to improve next. |
|||
|
|||
- Open your **3scale Admin Portal** by copying this URL in your web browser and changing the `userXY` by your actual username. |
|||
|
|||
```raw |
|||
{{< param 3scale_admin_portal_url >}} |
|||
``` |
|||
|
|||
- Go to **Beer Catalog API (PROD, v1.0)** (top dropdown list) |
|||
- Click **Analytics**, **Usage** |
|||
- Answer this question: **What is the most used method if the ACME Brewery API ?** |
|||
- Click **Response Codes** |
|||
- Answer this question: **Is the ACME Brewery API in good health?** |
|||
|
|||
To complete your understanding, explain **how ACME could get insights on how much beers have been exchanged through their API**. |
|||
@ -0,0 +1,33 @@ |
|||
--- |
|||
title: "Exercise" |
|||
weight: 1 |
|||
--- |
|||
|
|||
## Review the security of the ACME Brewery API! |
|||
|
|||
ACME released a first version of its Brewery API secured with API Keys. However, since high security is a stake, we need to update the security scheme to OpenID Connect. |
|||
|
|||
- Open the [APICurio Studio]({{< param apicurio_studio_url >}}/apis/import) |
|||
- Login with your account |
|||
- Copy [this URL](beer-catalog-2.0.yaml) and import it in APIcurio |
|||
- Review the existing design and try to determine what changed with the previous API Contract |
|||
- Open the [OpenShift Web Console]({{< param openshift_console_url >}}/console/catalog) |
|||
- Go to **Builds** > **Pipelines** |
|||
- Click on your pipeline (the one that ends with your username) |
|||
- Click **Actions** > **Edit** |
|||
- Change line number 8 from: |
|||
|
|||
```yaml |
|||
openapi_file: "api-contracts/beer-catalog-1.0.yaml", |
|||
``` |
|||
|
|||
to: |
|||
|
|||
```yaml |
|||
openapi_file: "api-contracts/beer-catalog-2.0.yaml", |
|||
``` |
|||
|
|||
- Click **Save** |
|||
- Click **Start Pipeline** |
|||
|
|||
Wait for your pipeline to finish! |
|||
@ -1,144 +0,0 @@ |
|||
{ |
|||
"swagger": "2.0", |
|||
"info": { |
|||
"title": "Beer Catalog API", |
|||
"description": "An API for querying beer catalog of Acme Inc.", |
|||
"contact": { |
|||
"name": "Laurent Broudoux", |
|||
"url": "http://github.com/lbroudoux", |
|||
"email": "laurent.broudoux@gmail.com" |
|||
}, |
|||
"license": { |
|||
"name": "MIT License", |
|||
"url": "https://opensource.org/licenses/MIT" |
|||
}, |
|||
"version": "1.0" |
|||
}, |
|||
"paths": { |
|||
"/beer/{name}": { |
|||
"get": { |
|||
"tags": [ |
|||
"beer" |
|||
], |
|||
"summary": "Get beer having name", |
|||
"description": "Get beer having name", |
|||
"operationId": "GetBeer", |
|||
"responses": { |
|||
"200": { |
|||
"description": "Beer having requested name", |
|||
"schema": { |
|||
"$ref": "#/definitions/Beer" |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "name", |
|||
"in": "path", |
|||
"description": "Name of beer to retrieve", |
|||
"required": true, |
|||
"type": "string" |
|||
} |
|||
] |
|||
}, |
|||
"/beer/findByStatus/{status}": { |
|||
"get": { |
|||
"tags": [ |
|||
"beer" |
|||
], |
|||
"summary": "Get beers having status", |
|||
"description": "Get beers having status", |
|||
"operationId": "FindBeersByStatus", |
|||
"responses": { |
|||
"200": { |
|||
"description": "List of beers having requested status", |
|||
"schema": { |
|||
"type": "array", |
|||
"items": { |
|||
"$ref": "#/definitions/Beer" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "status", |
|||
"in": "path", |
|||
"description": "Status of beers to retrieve", |
|||
"required": true, |
|||
"type": "string" |
|||
}, |
|||
{ |
|||
"name": "page", |
|||
"in": "query", |
|||
"description": "Number of page to retrieve", |
|||
"type": "number" |
|||
} |
|||
] |
|||
}, |
|||
"/beer": { |
|||
"get": { |
|||
"tags": [ |
|||
"beer" |
|||
], |
|||
"summary": "List beers within catalog", |
|||
"description": "List beers within catalog", |
|||
"operationId": "ListBeers", |
|||
"responses": { |
|||
"200": { |
|||
"description": "Array of beers", |
|||
"schema": { |
|||
"type": "array", |
|||
"items": { |
|||
"$ref": "#/definitions/Beer" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"parameters": [ |
|||
{ |
|||
"name": "page", |
|||
"in": "query", |
|||
"description": "Number of page to retrieve", |
|||
"type": "number" |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
"tags": [ |
|||
{ |
|||
"name": "beer", |
|||
"description": "Beer resource" |
|||
} |
|||
], |
|||
"definitions": { |
|||
"Beer": { |
|||
"properties": { |
|||
"name": { |
|||
"description": "Name of Beer", |
|||
"type": "string" |
|||
}, |
|||
"country": { |
|||
"description": "Origin country of Beer", |
|||
"type": "string" |
|||
}, |
|||
"type": { |
|||
"description": "Type of Beer", |
|||
"type": "string" |
|||
}, |
|||
"rating": { |
|||
"description": "Rating from customers", |
|||
"type": "number" |
|||
}, |
|||
"status": { |
|||
"description": "Stock status", |
|||
"type": "string" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,104 @@ |
|||
swagger: '2.0' |
|||
info: |
|||
title: 'Beer Catalog API' |
|||
description: 'An API for querying beer catalog of Acme Inc.' |
|||
contact: |
|||
name: 'Laurent Broudoux' |
|||
url: 'http://github.com/lbroudoux' |
|||
email: laurent.broudoux@gmail.com |
|||
license: |
|||
name: 'MIT License' |
|||
url: 'https://opensource.org/licenses/MIT' |
|||
version: '1.0' |
|||
basePath: /api |
|||
paths: |
|||
'/beer/{name}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beer having name' |
|||
description: 'Get beer having name' |
|||
operationId: GetBeer |
|||
responses: |
|||
'200': |
|||
description: 'Beer having requested name' |
|||
schema: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: name |
|||
in: path |
|||
description: 'Name of beer to retrieve' |
|||
required: true |
|||
type: string |
|||
'/beer/findByStatus/{status}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beers having status' |
|||
description: 'Get beers having status' |
|||
operationId: FindBeersByStatus |
|||
responses: |
|||
'200': |
|||
description: 'List of beers having requested status' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: status |
|||
in: path |
|||
description: 'Status of beers to retrieve' |
|||
required: true |
|||
type: string |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
/beer: |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'List beers within catalog' |
|||
description: 'List beers within catalog' |
|||
operationId: ListBeers |
|||
responses: |
|||
'200': |
|||
description: 'Array of beers' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
tags: |
|||
- name: beer |
|||
description: 'Beer resource' |
|||
definitions: |
|||
Beer: |
|||
properties: |
|||
name: |
|||
description: 'Name of Beer' |
|||
type: string |
|||
country: |
|||
description: 'Origin country of Beer' |
|||
type: string |
|||
type: |
|||
description: 'Type of Beer' |
|||
type: string |
|||
rating: |
|||
description: 'Rating from customers' |
|||
type: number |
|||
status: |
|||
description: 'Stock status' |
|||
type: string |
|||
securityDefinitions: |
|||
apikey: |
|||
type: apiKey |
|||
description: Use a 3scale API Key |
|||
name: api-key |
|||
in: header |
|||
security: |
|||
- apikey: [] |
|||
@ -0,0 +1,107 @@ |
|||
swagger: '2.0' |
|||
info: |
|||
title: 'Beer Catalog API' |
|||
description: 'An API for querying beer catalog of Acme Inc.' |
|||
contact: |
|||
name: 'Laurent Broudoux' |
|||
url: 'http://github.com/lbroudoux' |
|||
email: laurent.broudoux@gmail.com |
|||
license: |
|||
name: 'MIT License' |
|||
url: 'https://opensource.org/licenses/MIT' |
|||
version: '2.0' |
|||
basePath: /api |
|||
paths: |
|||
'/beer/{name}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beer having name' |
|||
description: 'Get beer having name' |
|||
operationId: GetBeer |
|||
responses: |
|||
'200': |
|||
description: 'Beer having requested name' |
|||
schema: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: name |
|||
in: path |
|||
description: 'Name of beer to retrieve' |
|||
required: true |
|||
type: string |
|||
'/beer/findByStatus/{status}': |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'Get beers having status' |
|||
description: 'Get beers having status' |
|||
operationId: FindBeersByStatus |
|||
responses: |
|||
'200': |
|||
description: 'List of beers having requested status' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: status |
|||
in: path |
|||
description: 'Status of beers to retrieve' |
|||
required: true |
|||
type: string |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
/beer: |
|||
get: |
|||
tags: |
|||
- beer |
|||
summary: 'List beers within catalog' |
|||
description: 'List beers within catalog' |
|||
operationId: ListBeers |
|||
responses: |
|||
'200': |
|||
description: 'Array of beers' |
|||
schema: |
|||
type: array |
|||
items: |
|||
$ref: '#/definitions/Beer' |
|||
parameters: |
|||
- name: page |
|||
in: query |
|||
description: 'Number of page to retrieve' |
|||
type: number |
|||
tags: |
|||
- name: beer |
|||
description: 'Beer resource' |
|||
definitions: |
|||
Beer: |
|||
properties: |
|||
name: |
|||
description: 'Name of Beer' |
|||
type: string |
|||
country: |
|||
description: 'Origin country of Beer' |
|||
type: string |
|||
type: |
|||
description: 'Type of Beer' |
|||
type: string |
|||
rating: |
|||
description: 'Rating from customers' |
|||
type: number |
|||
status: |
|||
description: 'Stock status' |
|||
type: string |
|||
securityDefinitions: |
|||
oidc: |
|||
type: oauth2 |
|||
flow: accessCode |
|||
authorizationUrl: https://filled-later.dummy/auth |
|||
tokenUrl: https://filled-later.dummy/token |
|||
scopes: |
|||
openid: Get an OpenID Connect token |
|||
security: |
|||
- oidc: |
|||
- openid |
|||
Loading…
Reference in new issue