Skip to content

Commit bff2a39

Browse files
committed
chore: fix schemas and paths
Signed-off-by: Matias Perrone <github@matiasperrone.com>
1 parent f23983b commit bff2a39

7 files changed

Lines changed: 848 additions & 399 deletions

File tree

app/Http/Controllers/Apis/Protected/Summit/OAuth2SummitSponsorApiController.php

Lines changed: 663 additions & 386 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'ExtraQuestionType',
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, format: "time_epoch"),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
15+
new OA\Property(property: 'name', type: 'string', ),
16+
new OA\Property(property: 'type', type: 'string', ),
17+
new OA\Property(property: 'label', type: 'string', ),
18+
new OA\Property(property: 'placeholder', type: 'string', ),
19+
new OA\Property(property: 'order', type: 'integer', ),
20+
new OA\Property(property: 'mandatory', type: 'boolean', ),
21+
new OA\Property(property: 'max_selected_values', type: 'integer', ),
22+
new OA\Property(property: 'class', type: 'string', ),
23+
new OA\Property(property: 'values', type: 'array', items: new OA\Items(
24+
oneOf: [
25+
new OA\Schema(ref: '#/components/schemas/ExtraQuestionTypeValue'),
26+
new OA\Schema(type: 'integer')
27+
]
28+
), description: 'ID of the ExtraQuestionTypeValue when included in relations, and full objects when expanded'),
29+
new OA\Property(property: 'sub_question_rules', type: 'array', items: new OA\Items(
30+
oneOf: [
31+
new OA\Schema(ref: '#/components/schemas/SubQuestionRule'),
32+
new OA\Schema(type: 'integer')
33+
]
34+
), description: 'Array of SubQuestionRule IDs when included in relations, and full objects when expanded'),
35+
new OA\Property(property: 'parent_rules', type: 'array', items: new OA\Items(
36+
oneOf: [
37+
new OA\Schema(ref: '#/components/schemas/SubQuestionRule'),
38+
new OA\Schema(type: 'integer')
39+
]
40+
), description: 'Array of SubQuestionRule IDs when included in relations, and full objects when expanded'),
41+
])
42+
]
43+
class ExtraQuestionTypeSchema
44+
{
45+
}

app/Swagger/Models/ExtraQuestionTypeValueSchema.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
type: 'object',
1010
properties: [
1111
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'created', type: 'integer', example: 1, format: "time_epoch"),
13+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
14+
new OA\Property(property: 'label', type: 'string', ),
1215
new OA\Property(property: 'value', type: 'string', example: 'Option 1'),
1316
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(property: 'question_id', type: 'integer', ),
18+
new OA\Property(property: 'is_default', type: 'boolean', ),
19+
new OA\Property(property: 'question', ref: '#/components/schemas/ExtraQuestionType', ),
1420
]
1521
)]
16-
class ExtraQuestionTypeValueSchema {}
22+
class ExtraQuestionTypeValueSchema
23+
{
24+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorBase',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'created', type: 'integer', example: 1, format: "time_epoch"),
13+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
14+
new OA\Property(property: 'order', type: 'integer'),
15+
new OA\Property(property: 'summit_id', type: 'integer'),
16+
new OA\Property(property: 'company_id', type: 'integer'),
17+
new OA\Property(property: 'is_published', type: 'boolean'),
18+
new OA\Property(property: 'side_image', type: 'string', format: 'url'),
19+
new OA\Property(property: 'header_image', type: 'string', format: 'url'),
20+
new OA\Property(property: 'header_image_mobile', type: 'string', format: 'url'),
21+
new OA\Property(property: 'carousel_advertise_image', type: 'string', format: 'url'),
22+
new OA\Property(property: 'marquee', type: 'string'),
23+
new OA\Property(property: 'intro', type: 'string'),
24+
new OA\Property(property: 'external_link', type: 'string'),
25+
new OA\Property(property: 'video_link', type: 'string'),
26+
new OA\Property(property: 'chat_link', type: 'string'),
27+
new OA\Property(property: 'featured_event_id', type: 'integer'),
28+
new OA\Property(property: 'header_image_alt_text', type: 'string'),
29+
new OA\Property(property: 'side_image_alt_text', type: 'string'),
30+
new OA\Property(property: 'header_image_mobile_alt_text', type: 'string'),
31+
new OA\Property(property: 'carousel_advertise_image_alt_text', type: 'string'),
32+
new OA\Property(property: 'show_logo_in_event_page', type: 'boolean'),
33+
new OA\Property(property: 'lead_report_setting_id', type: 'integer'),
34+
new OA\Property(property: 'extra_questions', type: 'array', items: new OA\Items(
35+
oneOf: [
36+
new OA\Schema(ref: '#/components/schemas/SummitSponsorExtraQuestionType'),
37+
new OA\Schema(type: 'integer')
38+
]
39+
), description: 'SummitSponsorExtraQuestionType Ids when included in the relations, and full objects when expanded'),
40+
new OA\Property(property: 'members', type: 'array', items: new OA\Items(
41+
oneOf: [
42+
new OA\Schema(ref: '#/components/schemas/Member'),
43+
new OA\Schema(type: 'integer')
44+
]
45+
), description: 'Member Ids when included in the relations, and full objects when expanded'),
46+
new OA\Property(property: 'summit', ref: '#/components/schemas/Summit', description: 'Summit object (Public) when included in expand'),
47+
new OA\Property(property: 'company', ref: '#/components/schemas/Company', description: 'Company object when included in expand'),
48+
new OA\Property(property: 'featured_event', ref: '#/components/schemas/SummitEvent', description: 'SummitEvent object when included in expand'),
49+
new OA\Property(property: 'lead_report_setting', ref: '#/components/schemas/SummitLeadReportSetting', description: 'SummitLeadReportSetting object when included in expand'),
50+
]
51+
)]
52+
class SponsorBaseSchema
53+
{
54+
}

app/Swagger/Models/SponsorSchema.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
#[OA\Schema(
88
schema: 'Sponsor',
99
type: 'object',
10-
properties: [
11-
new OA\Property(property: 'id', type: 'integer', example: 1),
12-
new OA\Property(property: 'company_id', type: 'integer', example: 1),
13-
new OA\Property(property: 'sponsorship_type_id', type: 'integer', example: 1),
14-
new OA\Property(property: 'order', type: 'integer', example: 1),
15-
new OA\Property(property: 'badge_scans_count', type: 'integer', example: 0),
16-
new OA\Property(property: 'links_count', type: 'integer', example: 0),
17-
new OA\Property(property: 'company', type: 'object', description: 'Company object'),
18-
new OA\Property(property: 'sponsorship', type: 'object', description: 'Sponsorship object'),
19-
new OA\Property(property: 'is_published', type: 'boolean', example: true),
20-
new OA\Property(property: 'sponsorships', type: 'array', items: new OA\Items(type: 'object'), nullable: true),
10+
allOf: [
11+
new OA\Schema(ref: '#/components/schemas/SponsorBase'),
12+
new OA\Schema(
13+
type: 'object',
14+
properties: [
15+
new OA\Property(property: 'sponsorship_id', type: 'integer'),
16+
new OA\Property(property: 'sponsorship', ref: '#/components/schemas/SummitSponsorship', description: 'SummitSponsorship when expanded'),
17+
]
18+
)
2119
]
2220
)]
23-
class SponsorSchema {}
21+
class SponsorSchema
22+
{
23+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorV2',
9+
type: 'object',
10+
allOf: [
11+
new OA\Schema(ref: '#/components/schemas/SponsorBase'),
12+
new OA\Schema(
13+
type: 'object',
14+
properties: [
15+
new OA\Property(property: 'sponsorships', type: 'array', items: new OA\Items(
16+
oneOf: [
17+
new OA\Schema(ref: '#/components/schemas/SummitSponsorship'),
18+
new OA\Schema(type: 'integer')
19+
]
20+
), description: 'SummitSponsorships Ids when included in relations and full objects when expanded'),
21+
]
22+
)
23+
]
24+
)]
25+
class SponsorV2Schema
26+
{
27+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
8+
#[OA\Schema(
9+
schema: 'SubQuestionRule',
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, format: "time_epoch"),
14+
new OA\Property(property: 'last_edited', type: 'integer', example: 1, format: "time_epoch"),
15+
new OA\Property(property: 'visibility', type: 'string'),
16+
new OA\Property(property: 'visibility_condition', type: 'string'),
17+
new OA\Property(property: 'answer_values', type: 'string_array'),
18+
new OA\Property(property: 'answer_values_operator', type: 'string'),
19+
new OA\Property(property: 'order', type: 'integer'),
20+
new OA\Property(property: 'sub_question_id', type: 'integer'),
21+
new OA\Property(property: 'parent_question_id', type: 'integer'),
22+
new OA\Property(property: 'sub_question_rules', type: 'array', items: new OA\Items(
23+
oneOf: [
24+
new OA\Schema(ref: '#/components/schemas/ExtraQuestionTypeValue'),
25+
new OA\Schema(type: 'integer')
26+
]
27+
), description: 'ID of the ExtraQuestionTypeValue when included in relations, and full objects when expanded'),
28+
new OA\Property(property: 'parent_rules', type: 'array', items: new OA\Items(
29+
oneOf: [
30+
new OA\Schema(ref: '#/components/schemas/ExtraQuestionTypeValue'),
31+
new OA\Schema(type: 'integer')
32+
]
33+
), description: 'ID of the ExtraQuestionTypeValue when included in relations, and full objects when expanded'),
34+
])
35+
]
36+
class SubQuestionRuleSchema
37+
{
38+
}

0 commit comments

Comments
 (0)