-
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.
Use
AbstractAnnotation::isRoot()
as strict check in `Analysis::getA…
…nnotationsOfType()` (#1425)
- Loading branch information
1 parent
40a23b0
commit 33960e0
Showing
3 changed files
with
94 additions
and
16 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,48 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Fixtures\Scratch; | ||
|
||
use OpenApi\Attributes as OAT; | ||
|
||
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] | ||
class AttributeInheritanceSchema extends OAT\Schema | ||
{ | ||
} | ||
|
||
#[OAT\Schema] | ||
class Base | ||
{ | ||
#[OAT\Property] | ||
public int $id; | ||
} | ||
|
||
#[AttributeInheritanceSchema] | ||
class Child1 extends Base | ||
{ | ||
#[OAT\Property] | ||
public string $name; | ||
} | ||
|
||
#[OAT\Schema] | ||
class Child2 extends Base | ||
{ | ||
#[OAT\Property] | ||
public string $title; | ||
} | ||
|
||
#[OAT\Info( | ||
title: 'Attribute Inheritance Scratch', | ||
version: '1.0' | ||
)] | ||
#[OAT\Get( | ||
path: '/api/endpoint', | ||
description: 'An endpoint', | ||
responses: [new OAT\Response(response: 200, description: 'OK')] | ||
)] | ||
class AttributeInheritanceEndpoint | ||
{ | ||
} |
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,36 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: 'Attribute Inheritance Scratch' | ||
version: '1.0' | ||
paths: | ||
/api/endpoint: | ||
get: | ||
description: 'An endpoint' | ||
responses: | ||
'200': | ||
description: OK | ||
components: | ||
schemas: | ||
Base: | ||
properties: | ||
id: | ||
type: integer | ||
type: object | ||
Child1: | ||
type: object | ||
allOf: | ||
- | ||
$ref: '#/components/schemas/Base' | ||
- | ||
properties: | ||
name: | ||
type: string | ||
Child2: | ||
type: object | ||
allOf: | ||
- | ||
$ref: '#/components/schemas/Base' | ||
- | ||
properties: | ||
title: | ||
type: string |