OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
vendor
/
zircote
/
swagger-php
/
tests
/
Fixtures
/
Scratch
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2024 04:34:54 AM
rwxr-xr-x
📄
AbstractBaseClass.php
251 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
AttributeInheritance.php
819 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
AttributeInheritance3.0.0.yaml
758 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
AttributeInheritance3.1.0.yaml
758 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
ClassRef.php
487 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
ClassRef3.0.0.yaml
362 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
ClassRef3.1.0.yaml
362 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
ComplexCustomAttributes.php
5.14 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
ComplexCustomAttributes3.0.0.yaml
1.41 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
ComplexCustomAttributes3.1.0.yaml
1.41 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributeSchema.php
596 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributeSchema3.0.0.yaml
298 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributeSchema3.1.0.yaml
298 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributes.php
2.2 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributes3.0.0.yaml
611 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomAttributes3.1.0.yaml
621 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomPropertyAttribute.php
671 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomPropertyAttribute3.0.0.yaml
347 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
CustomPropertyAttribute3.1.0.yaml
357 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
Docblocks.php
1.67 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
Docblocks3.0.0.yaml
1.66 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
Docblocks3.1.0.yaml
1.65 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
DuplicateRef.php
803 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
DuplicateRef3.0.0.yaml
552 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
DuplicateRef3.1.0.yaml
552 bytes
08/07/2024 04:34:54 AM
rw-r--r--
📄
Examples.php
1.25 KB
08/07/2024 04:34:54 AM
rw-r--r--
📄
Examples3.0.0.yaml
716 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
Examples3.1.0.yaml
789 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
ExclusiveMinMax.php
1021 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
ExclusiveMinMax3.0.0.yaml
976 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
ExclusiveMinMax3.1.0.yaml
832 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraits.php
1.14 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraits3.0.0.yaml
793 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraits3.1.0.yaml
793 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraitsExtended.php
1.67 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraitsExtended3.0.0.yaml
1.22 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
MergeTraitsExtended3.1.0.yaml
1.22 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
MultiplePathsForEndpoint.php
1014 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
MultiplePathsForEndpoint3.0.0.yaml
830 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
MultiplePathsForEndpoint3.1.0.yaml
830 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedAdditionalProperties.php
591 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedAdditionalProperties3.0.0.yaml
409 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedAdditionalProperties3.1.0.yaml
409 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedSchema.php
967 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedSchema3.0.0.yaml
681 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NestedSchema3.1.0.yaml
681 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NullRef.php
1.13 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
NullRef3.0.0.yaml
782 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
NullRef3.1.0.yaml
825 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
Nullable.php
1.17 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
Nullable3.0.0.yaml
1.27 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
Nullable3.1.0.yaml
1.34 KB
08/07/2024 04:34:55 AM
rw-r--r--
📄
ParameterContent.php
793 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
ParameterContent3.0.0.yaml
575 bytes
08/07/2024 04:34:55 AM
rw-r--r--
📄
ParameterContent3.1.0.yaml
575 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PromotedProperty.php
993 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PromotedProperty3.0.0.yaml
598 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PromotedProperty3.1.0.yaml
598 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PropertyInheritance.php
607 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PropertyInheritance3.0.0.yaml
483 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
PropertyInheritance3.1.0.yaml
483 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
RequestBody.php
1.4 KB
08/07/2024 04:34:56 AM
rw-r--r--
📄
RequestBody3.0.0.yaml
845 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
RequestBody3.1.0.yaml
845 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
ThirdPartyAnnotation.php
546 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
ThirdPartyAnnotation3.0.0.yaml
342 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
ThirdPartyAnnotation3.1.0.yaml
342 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
Types.php
676 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
Types3.1.0.yaml
578 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
UsingRefs.php
711 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
UsingRefs3.0.0.yaml
539 bytes
08/07/2024 04:34:56 AM
rw-r--r--
📄
UsingRefs3.1.0.yaml
539 bytes
08/07/2024 04:34:56 AM
rw-r--r--
Editing: ComplexCustomAttributes.php
Close
<?php declare(strict_types=1); /** * @license Apache 2.0 */ namespace OpenApi\Tests\Fixtures\Scratch; use OpenApi\Attributes as OAT; #[OAT\Info(version: '1.0.0', title: 'API')] class CustomAttributes { } #[\Attribute( \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE )] class Schema extends OAT\Schema { /** * @param class-string $of * * @throws \ReflectionException */ public function __construct( string $of, ?string $description = null, array $optional = [], ?int $minLength = null, ?int $maxLength = null, ) { $class = new \ReflectionClass($of); $required = null; foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { if (\in_array($property->getName(), $optional, true)) { continue; } $required[] = $property->getName(); } $shortName = $class->getShortName(); parent::__construct( schema: $shortName, title: $shortName, description: $description, required: $required, maxLength: $maxLength, minLength: $minLength ); } } #[\Attribute( \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE )] class Collection extends OAT\Property { /** @param class-string $of */ public function __construct( string $of, ?string $description = null ) { $shortName = (new \ReflectionClass($of))->getShortName(); parent::__construct( title: $shortName, description: $description, items: new OAT\Items(ref: "#/components/schemas/$shortName") ); } } #[\Attribute( \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE )] class Item extends OAT\Property { /** @param class-string $of */ public function __construct( string $of, ?string $description = null ) { $shortName = (new \ReflectionClass($of))->getShortName(); parent::__construct( ref: "#/components/schemas/$shortName", title: $shortName, description: $description, ); } } #[\Attribute( \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::TARGET_PARAMETER | \Attribute::TARGET_CLASS_CONSTANT | \Attribute::IS_REPEATABLE )] class Raw extends OAT\Property { public function __construct( ?string $title = null, ?string $description = null ) { parent::__construct( title: $title, description: $description, ); } } #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] class Successful extends OAT\Response { /** @param ?class-string $of */ public function __construct( ?string $of = null, ) { if ($of === null) { parent::__construct( response: 200, description: 'Operation complete' ); return; } $shortName = (new \ReflectionClass($of))->getShortName(); parent::__construct( response: 200, description: "Successful response of [$shortName]", content: new OAT\JsonContent( ref: "#/components/schemas/$shortName" ) ); } } final class TargetGroupController { #[ OAT\Get(path: '/target_groups', operationId: 'groups', summary: 'List target groups', tags: ['Target groups']), Successful(of: TargetGroupListDto::class) ] public function list(): string { } } #[Schema(of: TargetGroupListDto::class)] final class TargetGroupListDto { public function __construct( /** @var TargetGroupDto[] */ #[Collection(of: TargetGroupDto::class)] public readonly array $targetGroups = [] ) { } } #[Schema(of: TargetGroupDto::class)] final class TargetGroupDto { public function __construct( #[OAT\Property] # with my custom attribute #[Item] I also had problems public readonly string $groupId, #[OAT\Property] # with my custom attribute #[Item] I also had problems public readonly string $groupName, /** @var TargetDto[] */ #[Collection(of: TargetDto::class)] /* Same ... #[OAT\Property( title: 'TargetDto', items: new OAT\Items(ref: '#/components/schemas/TargetDto') )] */ public readonly array $targets = [] ) { } } #[Schema(of: TargetDto::class)] final class TargetDto { public function __construct( #[Item(of: TargetId::class)] public readonly string $targetId, #[Item(of: TargetType::class)] public readonly string $targetType, // ... ) { } } #[Schema(of: TargetId::class)] class TargetId { } #[Schema(of: TargetType::class)] class TargetType { }