Skip to content

Commit 67bdcf7

Browse files
andrestejerina97matiasperronematiasperrone-exo
authored
Feature | Extend Swagger Coverage for controller OAuth2SummitSponsorApiController (#473)
* feat: Extend Swagger Coverage for controller OAuth2SummitSponsorApiController * chore: fix/add OpenAPI incorrect or missing annotations Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: revert to main Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: fix schemas and paths Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: revert to main Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: linting style rolledback to main Signed-off-by: Matias Perrone <github@matiasperrone.com> * fix: repeated ExtraQuestionTypeValue schema Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: revert unexpected change Signed-off-by: Matias Perrone <github@matiasperrone.com> * fix: change in public endpoints, removal of unnecessary scope security * chore: remove duplicated ExtraQuestionTypeValueSchema Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: rename operationId "getLeadReportSettingsMetadata", "updateLeadReportSettings" and "addLeadReportSettings" operationIds Signed-off-by: Matias Perrone <github@matiasperrone.com> * chore: Add missing endpoints and change getAll responses Signed-off-by: matiasperrone-exo <matias.perrone@exomindset.co> * chore: fix operationId typo Signed-off-by: matiasperrone-exo <matias.perrone@exomindset.co> --------- Signed-off-by: Matias Perrone <github@matiasperrone.com> Signed-off-by: matiasperrone-exo <matias.perrone@exomindset.co> Co-authored-by: Matias Perrone <github@matiasperrone.com> Co-authored-by: matiasperrone-exo <matias.perrone@exomindset.co>
1 parent 2ad294d commit 67bdcf7

16 files changed

Lines changed: 3389 additions & 56 deletions

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

Lines changed: 2737 additions & 2 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+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'ExtraQuestionTypeValue',
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: 'label', type: 'string', ),
15+
new OA\Property(property: 'value', type: 'string', example: 'Option 1'),
16+
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', ),
20+
]
21+
)]
22+
class ExtraQuestionTypeValueSchema
23+
{
24+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorAd',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'text', type: 'string', example: 'Ad text'),
14+
new OA\Property(property: 'alt', type: 'string', example: 'Alt text for image'),
15+
new OA\Property(property: 'link', type: 'string', example: 'https://example.com'),
16+
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(property: 'image', ref: '#/components/schemas/File', nullable: true),
18+
]
19+
)]
20+
class SponsorAdSchema {}
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+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorMaterial',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'type', type: 'string', example: 'Presentation', enum: ['Presentation', 'Demo', 'Handout', 'Other']),
14+
new OA\Property(property: 'name', type: 'string', example: 'Material Name'),
15+
new OA\Property(property: 'description', type: 'string', example: 'Material description', nullable: true),
16+
new OA\Property(property: 'order', type: 'integer', example: 1),
17+
new OA\Property(property: 'file', ref: '#/components/schemas/File', nullable: true),
18+
]
19+
)]
20+
class SponsorMaterialSchema {}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'Sponsor',
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: 'sponsorship_id', type: 'integer'),
16+
new OA\Property(property: 'sponsorship', ref: '#/components/schemas/SummitSponsorship', description: 'SummitSponsorship when expanded'),
17+
]
18+
)
19+
]
20+
)]
21+
class SponsorSchema
22+
{
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace App\Swagger\schemas;
4+
5+
use OpenApi\Attributes as OA;
6+
7+
#[OA\Schema(
8+
schema: 'SponsorSocialNetwork',
9+
type: 'object',
10+
properties: [
11+
new OA\Property(property: 'id', type: 'integer', example: 1),
12+
new OA\Property(property: 'sponsor_id', type: 'integer', example: 1),
13+
new OA\Property(property: 'link', type: 'string', example: 'https://twitter.com/example'),
14+
new OA\Property(property: 'enabled', type: 'boolean', example: true),
15+
new OA\Property(property: 'icon_css_class', type: 'string', example: 'fab fa-twitter'),
16+
]
17+
)]
18+
class SponsorSocialNetworkSchema {}
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: 'array', items: new OA\Items(type: 'string')),
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)