Skip to content

Commit

Permalink
Fixed the webhook example (OAI#2434)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Franchin dos Santos <[email protected]>
  • Loading branch information
christianfds authored Feb 11, 2021
1 parent e32baaa commit f1adc84
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 65 deletions.
38 changes: 0 additions & 38 deletions examples/v3.1/webhook-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,6 @@
"title": "Webhook Example",
"version": "1.0.0"
},
"paths": {
"/pets": {
"get": {
"summary": "List all pets",
"operationId": "listPets",
"parameters": [
{
"name": "limit",
"in": "query",
"description": "How many items to return at one time (max 100)",
"required": false,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "A paged array of pets",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pets"
}
}
}
}
}
}
}
},
"webhooks": {
"newPet": {
"post": {
Expand Down Expand Up @@ -76,12 +44,6 @@
"type": "string"
}
}
},
"Pets": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
Expand Down
28 changes: 1 addition & 27 deletions examples/v3.1/webhook-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,7 @@ openapi: 3.1.0
info:
title: Webhook Example
version: 1.0.0
paths:
# OpenAPI documents all need a paths element
/pets:
get:
summary: List all pets
operationId: listPets
parameters:
- name: limit
in: query
description: How many items to return at one time (max 100)
required: false
schema:
type: integer
format: int32
responses:
'200':
description: A paged array of pets
content:
application/json:
schema:
$ref: "#/components/schemas/Pets"

# Since OAS 3.1.0 the paths element isn't necessary. Now a valid OpenAPI Document can describe only paths, webhooks, or even only reusable components
webhooks:
# Each webhook needs a name
newPet:
Expand Down Expand Up @@ -53,9 +32,4 @@ components:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"


0 comments on commit f1adc84

Please sign in to comment.