Skip to content

Commit e25c377

Browse files
authored
Add response (body) scratch test (#1808)
1 parent 23b2421 commit e25c377

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php declare(strict_types=1);
2+
3+
/**
4+
* @license Apache 2.0
5+
*/
6+
7+
namespace OpenApi\Tests\Fixtures\Scratch;
8+
9+
use OpenApi\Attributes as OAT;
10+
11+
#[OAT\Info(title: 'Response', version: '1.0')]
12+
class ResponseController
13+
{
14+
#[OAT\Post(
15+
path: '/endpoint/response-schema',
16+
responses: [
17+
new OAT\Response(
18+
response: 200,
19+
description: 'All good',
20+
content: new OAT\MediaType(
21+
mediaType: 'application/octet-stream',
22+
schema: new OAT\Schema(
23+
type: 'string',
24+
format: 'byte',
25+
),
26+
),
27+
),
28+
]
29+
)]
30+
public function responseSchema()
31+
{
32+
}
33+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Response
4+
version: '1.0'
5+
paths:
6+
/endpoint/response-schema:
7+
post:
8+
operationId: 1c263833c8db6ca090be27b517d92017
9+
responses:
10+
'200':
11+
description: 'All good'
12+
content:
13+
application/octet-stream:
14+
schema:
15+
type: string
16+
format: byte
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Response
4+
version: '1.0'
5+
paths:
6+
/endpoint/response-schema:
7+
post:
8+
operationId: 1c263833c8db6ca090be27b517d92017
9+
responses:
10+
'200':
11+
description: 'All good'
12+
content:
13+
application/octet-stream:
14+
schema:
15+
type: string
16+
format: byte

0 commit comments

Comments
 (0)