Skip to content

Commit 8f5aafb

Browse files
committed
chore: add ref schemas
1 parent b2f0692 commit 8f5aafb

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

app/Swagger/Models/ApplianceSchema.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
new OA\Property(property: 'openstack_tested_info', type: 'string', example: 'Tested with OpenStack Yoga'),
2727
new OA\Property(property: 'company_id', type: 'integer', example: 41, description: 'ID of the company that provides this appliance, visible only when is not expanded'),
2828
new OA\Property(property: 'company', ref: '#/components/schemas/Company', description: 'Company that provides this appliance, visible only when expanded'),
29-
new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the type of this appliance, visible only when not expanded'),
30-
new OA\Property(property: 'type', ref: '#/components/schemas/MarketPlaceType', description: 'Type of this appliance, visible only when expanded'),
31-
new OA\Property(property: 'types', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceType'), description: 'Regional support of this appliance, visible only when requested as relation'),
29+
new OA\Property(property: 'type_id', type: 'integer', example: 13, description: 'ID of the MarketPlaceType of this appliance, visible only when not expanded'),
3230
new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview', title: 'MarketPlaceReview'), description: 'Reviews of this appliance, visible only when expanded'),
3331
new OA\Property(property: 'capabilities', type: 'array', items: new OA\Items(ref: '#/components/schemas/OpenStackImplementationApiCoverage'), description: 'Capabilities of this appliance, visible only when requested as relation'),
3432
new OA\Property(property: 'hypervisors', type: 'array', items: new OA\Items(ref: '#/components/schemas/HyperVisorType'), description: 'Hypervisors of this appliance, visible only when requested as relation'),
3533
new OA\Property(property: 'guests', type: 'array', items: new OA\Items(ref: '#/components/schemas/GuestOSType'), description: 'GuestOSType of this appliance, visible only when requested as relation'),
3634
new OA\Property(property: 'supported_regions', type: 'array', items: new OA\Items(ref: '#/components/schemas/RegionalSupport'), description: 'Regional support of this appliance, visible only when requested as relation'),
35+
// @TODO: Investigate how to reference properly, as it is present in ApplianceSerializer, but does not to have a serializer asociated
36+
// new OA\Property(property: 'type', ref: '#/components/schemas/MarketPlaceType', description: 'MarketPlaceType of this appliance, visible only when expanded'),
3737
],
3838
)]
3939
class ApplianceSchema
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'MarketPlaceReview',
10+
type: 'object',
11+
properties: [
12+
new OA\Property(property: 'id', type: 'integer', example: 1),
13+
new OA\Property(property: 'created', type: 'integer', example: 1),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1),
15+
new OA\Property(property: 'title', type: 'string'),
16+
new OA\Property(property: 'comment', type: 'string'),
17+
new OA\Property(property: 'rating', type: 'integer'),
18+
])
19+
]
20+
class MarketPlaceReviewSchema
21+
{
22+
}

0 commit comments

Comments
 (0)