Open diego-aquino opened 3 months ago
It is possible for paths to be long and contain many path params. This makes referencing the full paths in interceptors verbose.
interceptor .get('/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts') .respond({ status: 200 })
A possible enhancement is to support path aliases, such as the one showed bellow.
interceptor.get .requiredStatusCheckBranchContexts(owner, repo, branch) .respond({ status: 200 })
Path aliases would be declared at the interceptor level and would be a function receiving any types or number of arguments and returning a string: the path aliased to.
const interceptor = httpInterceptor.create<....>({ ..., pathAliases: { GET: { requiredStatusCheckBranchContexts(owner: string, repo: string, branch: string) { return `/repos/${owner}/${repo}/branches/${branch}/protection/required_status_checks/contexts` as const } } } })
However, I am not sure if adding a new API is worth the benefits.
It is possible for paths to be long and contain many path params. This makes referencing the full paths in interceptors verbose.
A possible enhancement is to support path aliases, such as the one showed bellow.
Path aliases would be declared at the interceptor level and would be a function receiving any types or number of arguments and returning a string: the path aliased to.
However, I am not sure if adding a new API is worth the benefits.