Skip to content

Commit

Permalink
Add scratch test for multi path endpoints (#1492)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann authored Oct 26, 2023
1 parent e67dfd9 commit 2cd2d91
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/Fixtures/Scratch/MultiplePathsForEndpoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php declare(strict_types=1);

/**
* @license Apache 2.0
*/

namespace OpenApi\Tests\Fixtures\Scratch;

use OpenApi\Attributes as OAT;

#[OAT\Info(
title: 'Multiple Paths For Endpoint Scratch',
version: '1.0'
)]
#[OAT\Get(
path: '/api/class/endpoint',
description: 'A class endpoint',
responses: [new OAT\Response(response: 200, description: 'OK')]
)]
#[OAT\Get(
path: '/api/class/endpoint2',
description: 'Another class endpoint',
responses: [new OAT\Response(response: 200, description: 'OK')]
)]
class MultiplePathsForClassEndpoint
{
}

class MultiplePathsForMethodEndpoint
{
#[OAT\Get(
path: '/api/method/endpoint',
description: 'A method endpoint',
responses: [new OAT\Response(response: 200, description: 'OK')]
)]
#[OAT\Get(
path: '/api/method/endpoint2',
description: 'Another method endpoint',
responses: [new OAT\Response(response: 200, description: 'OK')]
)]
public function endpoint()
{
}
}
31 changes: 31 additions & 0 deletions tests/Fixtures/Scratch/MultiplePathsForEndpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
openapi: 3.0.0
info:
title: 'Multiple Paths For Endpoint Scratch'
version: '1.0'
paths:
/api/class/endpoint:
get:
description: 'A class endpoint'
responses:
'200':
description: OK
/api/class/endpoint2:
get:
description: 'Another class endpoint'
responses:
'200':
description: OK
/api/method/endpoint:
get:
description: 'A method endpoint'
operationId: b134e3908c5787b578f7faaa63283168
responses:
'200':
description: OK
/api/method/endpoint2:
get:
description: 'Another method endpoint'
operationId: ff3758f75b33d1e680c47e92ed39844f
responses:
'200':
description: OK

0 comments on commit 2cd2d91

Please sign in to comment.