Skip to content

InvocationContext should be second parameter to HTTP trigger function #34

@aaronpowell

Description

@aaronpowell

In the v4 programming model, we write HTTP trigger functions have a type signature of:

export type HttpHandler = (context: InvocationContext, request: HttpRequest) => FunctionResult<HttpResponse>;

But the InvocationContext is not something that you necessarily need, meaning that it's quite common to have it as an ignored argument, resulting in a TypeScript warning, ts(6133).

Propose solution

Reorder the type signature (and underlying code) so that the HttpRequest is the first argument, allowing the InvocationContext argument to dropped if it's not needed.

Metadata

Metadata

Assignees

Labels

breakingenhancementv4 🚀We no longer use this label since v4 is now the default model.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions