Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I kept the two commits in the same PR. Though they are not directly semantically related, they change the same lines and would trigger conflicts. If it is desirable as two PRs, I can update it.
Use type literal for path
Using string literal type should not break anything (tested on a
larger project) since it is a subtype of string.
Using literal instead of generic string allows to do type-safe
RPC matching, for example it generic middlewares for cache, ACL etc.
Without it we need to match a string for path (long, prone to errors) or
method names (ambiguous) and have no way to check, wheather the matching
is correct or not.
With literals, we can extract all paths from generated stubs with
meta-typing and use it in these occasions.
Fix path composition on missing package
Correct RPC paths (also aligned with the grpc implementation) are
/Package.Service/Method
/Service/Method
(undefined package)Currently the template does not handle well services without package
/Package.Service/Method
white_check_mark/.Service/Method
x (extra dot)This commit adds the dot conditionally only if Package is not falsy