Skip to content

Commit

Permalink
Add Types31 test
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Nov 24, 2023
1 parent d4aab3d commit f712c8a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Fixtures/Scratch/Types31.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php declare(strict_types=1);

/**
* @license Apache 2.0
*/

namespace OpenApi\Tests\Fixtures\Scratch;

use OpenApi\Attributes as OAT;

#[OAT\Schema]
class Types31
{
#[OAT\Property(type: ['string', 'integer'])]
public string|int $stringInteger = '';

#[OAT\Property(type: ['string', 'number', 'integer', 'boolean', 'array', 'object', 'null'])]
public mixed $massiveTypes = '';
}

#[OAT\OpenApi(openapi: '3.1.0')]
#[OAT\Info(
title: 'List of types',
version: '1.0'
)]
#[OAT\Get(
path: '/api/endpoint',
description: 'An endpoint',
responses: [new OAT\Response(response: 200, description: 'OK')]
)]
class Types31Endpoint
{
}
30 changes: 30 additions & 0 deletions tests/Fixtures/Scratch/Types31.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
openapi: 3.1.0
info:
title: 'List of types'
version: '1.0'
paths:
/api/endpoint:
get:
description: 'An endpoint'
operationId: 20a99cdde4e09b297c7555321c7cdb6f
responses:
'200':
description: OK
components:
schemas:
Types31:
properties:
stringInteger:
type:
- string
- integer
massiveTypes:
type:
- string
- number
- integer
- boolean
- array
- object
- 'null'
type: object

0 comments on commit f712c8a

Please sign in to comment.