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

Route-level mergeParams doesn't exist for auto aliases #333

Open
ggondim opened this issue Sep 5, 2023 · 1 comment
Open

Route-level mergeParams doesn't exist for auto aliases #333

ggondim opened this issue Sep 5, 2023 · 1 comment

Comments

@ggondim
Copy link

ggondim commented Sep 5, 2023

The mergeParams feature exists at the route-level when declared directly in the API Gateway. However, Auto-alias does not have this feature at the route-level.

At present, auto-alias only supports fullPath, basePath, path and method.

Aliases should have consistent features, whether they are declared in the gateway service or as auto-aliases.

This inconsistency directly affects the ecosystem of modules and plugins, both official and third-party. They are hindered in their ability to set route-level options in services.

For instance, moleculer-db (an official module) has already indicated its lack of support for a global mergeParams: false setting in the API Gateway (Issue #83). Should developers really be mandated to use mergeParams: true when working with moleculer-db?

To cite another case, I'm developing a third-party module named moleculer-mongobubble. It's a mixin that generates actions with auto-aliases, similar to moleculer-db. Due to this issue, it cannot determine if developers have set the mergeParams flag to true or false. This forces me to add extra conditionals to discern how parameters were passed to each action.

@ggondim ggondim changed the title Route-level mergeParams doesn't exists for auto aliases Route-level mergeParams doesn't exist for auto aliases Sep 5, 2023
@icebob
Copy link
Member

icebob commented Sep 7, 2023

so an action level mergeParams could solve this problem, right? I will check whether it can be implemented or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants