-
Notifications
You must be signed in to change notification settings - Fork 2
Feature | Extend Swagger Coverage for controller RemoteCloudsApiController
#361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
4f4b976 to
9ed27c0
Compare
3ac00a5 to
95727fa
Compare
e3e142a to
161d4d3
Compare
app/Http/Controllers/Apis/Marketplace/RemoteCloudsApiController.php
Outdated
Show resolved
Hide resolved
smarcet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasperrone-exo review comments
|
@smarcet please review, all the requested changes were incorporated. |
c94fc68 to
9a8387b
Compare
d829347 to
68b1898
Compare
|
Hello @smarcet The changes were introduced from main, and as requested the schemas were move to its schema file. Please review the PR again |
RemoteCloudsApiController.php
RemoteCloudsApiController.phpRemoteCloudsApiController
30526a7 to
c9819cf
Compare
ed15034 to
cdd3f91
Compare
caseylocker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matiasperrone-exo
In "RemoteCloudsResponse" these are invalid property types - 'Company', 'MarketPlaceType', 'MarketPlaceReview' - and render with "Unknown Type:" in the Swagger documentation. Should use ref.
'company' => new OA\Property(property: 'company', type: 'Company'),
'type' => new OA\Property(property: 'type', type: 'MarketPlaceType'),
'reviews' => new OA\Property(property: 'reviews', type: 'array', items: new OA\Items(type: 'MarketPlaceReview')),
Example:
'company' => new OA\Property(
property: 'company',
ref: '#/components/schemas/Company',
description: 'Company object (when expanded)',
nullable: true
),
'type' => new OA\Property(
property: 'type',
ref: '#/components/schemas/MarketPlaceType',
description: 'Marketplace type object (when expanded)',
nullable: true
),
'reviews' => new OA\Property(
property: 'reviews',
type: 'array',
items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview'),
description: 'Customer reviews (when expanded)',
nullable: true
),
Expanded parameters should list "reviews" as it's in the schema and but not currently in the list.
Be more descriptive - in keeping with other PRs - with the filter expressions:
description: 'Filter expressions in the format fieldvalue. Available fields: name, company. Operators: == (equals), =@ (starts with), @@ (contains).',
Is it's missing the 'page' and 'per_page' parameters.
62b7caf to
3f7b2c2
Compare
fc19c63 to
7e5d26f
Compare
caseylocker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Globally:
response: 200, // Should be Response::HTTP_OK
app/Swagger/MarketplaceSchemas.php:
Invalid types used: 'company' and 'MarketPlaceType', 'MarketPlaceReview'
For 'company' and 'MarketPlaceType' either reference an existing/new schema or just use the id integers and document the other on expansion.
For 'reviews', since the schema exists:
'reviews' => new OA\Property(
property: 'reviews',
type: 'array',
items: new OA\Items(ref: '#/components/schemas/MarketPlaceReview'),
description: 'Approved reviews. Only available with ?relations=reviews&expand=reviews'
),
e3df0c6 to
5402d01
Compare
caseylocker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
|
@matiasperrone this branch need a rebase against main and fixing the conflicts |
c6ecdd0 to
728ae67
Compare
…, type, and reviews
5402d01 to
3cb78f9
Compare
|
@smarcet now it is rebased! |
Task:
Ref: https://app.clickup.com/t/86b6wkgg5