-
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.
Extend ExpandXXX processors to also consider ancestor traits (#1331)
- Loading branch information
1 parent
b676979
commit 6bd5335
Showing
18 changed files
with
391 additions
and
58 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
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
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
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
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
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,79 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/** | ||
* @license Apache 2.0 | ||
*/ | ||
|
||
namespace OpenApi\Tests\Fixtures\Scratch; | ||
|
||
use OpenApi\Annotations as OA; | ||
|
||
trait HasId | ||
{ | ||
/** | ||
* @OA\Property( | ||
* format="int64", | ||
* readOnly=true, | ||
* ) | ||
* | ||
* @var int | ||
*/ | ||
public int $id; | ||
} | ||
|
||
trait HasTimestamps | ||
{ | ||
/** | ||
* @OA\Property( | ||
* format="date-time", | ||
* type="string", | ||
* readOnly=true, | ||
* ) | ||
*/ | ||
public \DateTime $created_at; | ||
|
||
/** | ||
* @OA\Property( | ||
* format="date-time", | ||
* type="string", | ||
* readOnly=true, | ||
* ) | ||
*/ | ||
public \DateTime $updated_at; | ||
} | ||
|
||
abstract class Model | ||
{ | ||
use HasId; | ||
} | ||
|
||
/** | ||
* @OA\Schema( | ||
* required={"street"}, | ||
* @OA\Xml( | ||
* name="Address" | ||
* ) | ||
* ) | ||
*/ | ||
class Address extends Model | ||
{ | ||
use HasTimestamps; | ||
|
||
/** @OA\Property */ | ||
public string $street; | ||
} | ||
|
||
/** | ||
* @OA\Info(title="API", version="1.0") | ||
* @OA\Get( | ||
* path="/api/endpoint", | ||
* @OA\Response( | ||
* response=200, | ||
* description="successful operation", | ||
* @OA\JsonContent(ref="#/components/schemas/Address") | ||
* ) | ||
* ) | ||
*/ | ||
class Endpoint | ||
{ | ||
} |
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,37 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: API | ||
version: '1.0' | ||
paths: | ||
/api/endpoint: | ||
get: | ||
responses: | ||
'200': | ||
description: 'successful operation' | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Address' | ||
components: | ||
schemas: | ||
Address: | ||
required: | ||
- street | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
readOnly: true | ||
created_at: | ||
type: string | ||
format: date-time | ||
readOnly: true | ||
updated_at: | ||
type: string | ||
format: date-time | ||
readOnly: true | ||
street: | ||
type: string | ||
type: object | ||
xml: | ||
name: Address |
Oops, something went wrong.