Skip to content

Commit 8988439

Browse files
christianfdscharjr
authored andcommitted
Fixed the webhook example (OAI#2434)
Signed-off-by: Christian Franchin dos Santos <[email protected]>
1 parent 57d12fb commit 8988439

File tree

2 files changed

+1
-65
lines changed

2 files changed

+1
-65
lines changed

examples/v3.1/webhook-example.json

-38
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,6 @@
44
"title": "Webhook Example",
55
"version": "1.0.0"
66
},
7-
"paths": {
8-
"/pets": {
9-
"get": {
10-
"summary": "List all pets",
11-
"operationId": "listPets",
12-
"parameters": [
13-
{
14-
"name": "limit",
15-
"in": "query",
16-
"description": "How many items to return at one time (max 100)",
17-
"required": false,
18-
"schema": {
19-
"type": "integer",
20-
"format": "int32"
21-
}
22-
}
23-
],
24-
"responses": {
25-
"200": {
26-
"description": "A paged array of pets",
27-
"content": {
28-
"application/json": {
29-
"schema": {
30-
"$ref": "#/components/schemas/Pets"
31-
}
32-
}
33-
}
34-
}
35-
}
36-
}
37-
}
38-
},
397
"webhooks": {
408
"newPet": {
419
"post": {
@@ -76,12 +44,6 @@
7644
"type": "string"
7745
}
7846
}
79-
},
80-
"Pets": {
81-
"type": "array",
82-
"items": {
83-
"$ref": "#/components/schemas/Pet"
84-
}
8547
}
8648
}
8749
}

examples/v3.1/webhook-example.yaml

+1-27
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,7 @@ openapi: 3.1.0
22
info:
33
title: Webhook Example
44
version: 1.0.0
5-
paths:
6-
# OpenAPI documents all need a paths element
7-
/pets:
8-
get:
9-
summary: List all pets
10-
operationId: listPets
11-
parameters:
12-
- name: limit
13-
in: query
14-
description: How many items to return at one time (max 100)
15-
required: false
16-
schema:
17-
type: integer
18-
format: int32
19-
responses:
20-
'200':
21-
description: A paged array of pets
22-
content:
23-
application/json:
24-
schema:
25-
$ref: "#/components/schemas/Pets"
26-
5+
# 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
276
webhooks:
287
# Each webhook needs a name
298
newPet:
@@ -53,9 +32,4 @@ components:
5332
type: string
5433
tag:
5534
type: string
56-
Pets:
57-
type: array
58-
items:
59-
$ref: "#/components/schemas/Pet"
60-
6135

0 commit comments

Comments
 (0)