| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,38 +4,6 @@ | |||
| 4 | 4 | "title": "Webhook Example", | |
| 5 | 5 | "version": "1.0.0" | |
| 6 | 6 | }, | |
| 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 | - }, | ||
| 39 | 7 | "webhooks": { | |
| 40 | 8 | "newPet": { | |
| 41 | 9 | "post": { | |
@@ -76,12 +44,6 @@ | |||
| 76 | 44 | "type": "string" | |
| 77 | 45 | } | |
| 78 | 46 | } | |
| 79 | - }, | ||
| 80 | - "Pets": { | ||
| 81 | - "type": "array", | ||
| 82 | - "items": { | ||
| 83 | - "$ref": "#/components/schemas/Pet" | ||
| 84 | - } | ||
| 85 | 47 | } | |
| 86 | 48 | } | |
| 87 | 49 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,28 +2,7 @@ openapi: 3.1.0 | |||
| 2 | 2 | info: | |
| 3 | 3 | title: Webhook Example | |
| 4 | 4 | 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 | ||
| 27 | 6 | webhooks: | |
| 28 | 7 | # Each webhook needs a name | |
| 29 | 8 | newPet: | |
@@ -53,9 +32,4 @@ components: | |||
| 53 | 32 | type: string | |
| 54 | 33 | tag: | |
| 55 | 34 | type: string | |
| 56 | - Pets: | ||
| 57 | - type: array | ||
| 58 | - items: | ||
| 59 | - $ref: "#/components/schemas/Pet" | ||
| 60 | - | ||
| 61 | 35 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments