-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b6b680
commit b25ac10
Showing
17 changed files
with
264 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace OpenApi\Examples\Webhooks; | ||
|
||
use OpenApi\Attributes as OAT; | ||
use OpenApi\Annotations as OA; | ||
|
||
#[OAT\Schema(required: ['id', 'name'])] | ||
/** | ||
* @OA\Schema(required={"id", "name"}) | ||
*/ | ||
final class Pet | ||
{ | ||
#[OAT\Property(format: 'int64')] | ||
public int $id; | ||
/** | ||
* @OA\Property(format="int64") | ||
* | ||
* @var int | ||
*/ | ||
public $id; | ||
|
||
#[OAT\Property] | ||
public string $name; | ||
/** | ||
* @OA\Property | ||
* | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
#[OAT\Property] | ||
public string $tag; | ||
/** | ||
* @OA\Property | ||
* | ||
* @var string | ||
*/ | ||
public $tag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace OpenApi\Examples\Webhooks81; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[OAT\OpenApi( | ||
info: new OAT\Info(version: '1.0.0', title: 'Webhook Example'), | ||
webhooks: [ | ||
new OAT\Webhook( | ||
webhook: 'newPet', | ||
path: new OAT\PathItem( | ||
post: new OAT\Post( | ||
requestBody: new OAT\RequestBody( | ||
description: 'Information about a new pet in the system', | ||
content: new OAT\MediaType( | ||
mediaType: 'application/json', | ||
schema: new OAT\Schema(ref: Pet::class) | ||
) | ||
), | ||
responses: [ | ||
new OAT\Response( | ||
response: 200, | ||
description: 'Return a 200 status to indicate that the data was received successfully' | ||
), | ||
] | ||
) | ||
) | ||
), | ||
], | ||
)] | ||
class OpenApiSpec | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace OpenApi\Examples\Webhooks81; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[OAT\Schema(required: ['id', 'name'])] | ||
final class Pet | ||
{ | ||
#[OAT\Property(format: 'int64')] | ||
public int $id; | ||
|
||
#[OAT\Property] | ||
public string $name; | ||
|
||
#[OAT\Property] | ||
public string $tag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: 'Webhook Example' | ||
version: 1.0.0 | ||
components: | ||
schemas: | ||
Pet: | ||
required: | ||
- id | ||
- name | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
tag: | ||
type: string | ||
type: object | ||
webhooks: | ||
newPet: | ||
post: | ||
operationId: bbbe318bf00166ae6ba3552197e5f089 | ||
requestBody: | ||
description: 'Information about a new pet in the system' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
responses: | ||
'200': | ||
description: 'Return a 200 status to indicate that the data was received successfully' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.