-
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
430d4aa
commit 99b04b5
Showing
4 changed files
with
101 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Fixtures\Scratch; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[OAT\Info(title: 'DuplicateRef', version: '1.0')] | ||
#[OAT\Get( | ||
path: '/api/endpoint', | ||
description: 'An endpoint', | ||
responses: [new OAT\Response(response: 200, description: 'OK')] | ||
)] | ||
class DuplicateRefEndpoint | ||
{ | ||
} | ||
|
||
#[OAT\Schema( | ||
schema: 'abstract-user', | ||
properties: [ | ||
new OAT\Property(property: 'name', type: 'string'), | ||
new OAT\Property(property: 'email', type: 'string'), | ||
] | ||
)] | ||
class AbstractUser | ||
{ | ||
} | ||
|
||
#[OAT\Schema( | ||
schema: 'create-user', | ||
allOf: [ | ||
new OAT\Schema(ref: '#/components/schemas/abstract-user'), | ||
new OAT\Schema(required: ['name', 'email']), | ||
] | ||
)] | ||
class CreateUser extends AbstractUser | ||
{ | ||
} |
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,28 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: DuplicateRef | ||
version: '1.0' | ||
paths: | ||
/api/endpoint: | ||
get: | ||
description: 'An endpoint' | ||
responses: | ||
'200': | ||
description: OK | ||
components: | ||
schemas: | ||
abstract-user: | ||
properties: | ||
name: | ||
type: string | ||
email: | ||
type: string | ||
type: object | ||
create-user: | ||
allOf: | ||
- | ||
$ref: '#/components/schemas/abstract-user' | ||
- | ||
required: | ||
- name | ||
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