Skip to content
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

Use api route prefix parameter instead of /api/v2 #13881

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

Prometee
Copy link
Contributor

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #13854
License MIT

Small PR to be able to use another api route prefix while generating the swagger page.

@Prometee Prometee requested a review from a team as a code owner April 15, 2022 17:38
@probot-autolabeler probot-autolabeler bot added the API APIs related issues and PRs. label Apr 15, 2022
@Prometee Prometee changed the title Use api route prefix parameter instead of fixed /api/v2 Use api route prefix parameter instead of /api/v2 Apr 15, 2022
Copy link
Member

@lchrusciel lchrusciel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should perhaps introduce some specs for these classes

@@ -45,17 +38,18 @@ public function normalize($object, $format = null, array $context = [])
$enums = $this->filterProvider->provideShopFilters();
$enums = array_keys($enums);

$params = $docs['paths'][self::SHOP_ITEM_PATH]['get']['parameters'];
$shopProductImagePath = $this->apiRoute . '/shop/product-images/{id}';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave suffix as a const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think of it but it was a private const so it wasn't editable nor accessible.

@lchrusciel lchrusciel added Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). DX Issues and PRs aimed at improving Developer eXperience. labels Apr 25, 2022
@lchrusciel lchrusciel merged commit 6cbcaa8 into Sylius:master Apr 25, 2022
@lchrusciel
Copy link
Member

Thanks, Francis! 🎉

@Prometee
Copy link
Contributor Author

@lchrusciel I'm also thinking about doing this kind of api route prefix for the Behat tests, because it forces us to use /api/v2 too.

@Prometee Prometee deleted the swagger-api-path branch April 25, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs. DX Issues and PRs aimed at improving Developer eXperience. Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: Undefined array key "/api/v2/shop/product-images/{id}"
2 participants