Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scratch test for multi path endpoints #1492

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading