Azure / Azure/azure-functions-core-tools
Convention-based FunctionName & HttpTrigger Routes
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 498
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 14
Description
To enable MVC-like conventions within functions, I wish:
there was a parameter-less version of the FunctionNameAttribute that would default the name to:
`$"{typeof().Namespace}.{nameof()}"`
the HttpTriggerAttribute Route property was optional and would default to:
`$"{typeof().Namespace}.{nameof()}".Replace('.', '/');`
The goal would be so that these two would produce the same result.


Note: I think the snippets above might need more logic. For example, I'd prefer to not include the first namespace if there is more than one (eg: "Service" from the screenshot above). The first namespace is often just the solution name or something that you don't necessarily want reflected in the route.
Contributor guide
Research direction
Start with the FunctionNameAttribute and HttpTriggerAttribute behavior described in the issue, including how namespaces are represented in names and routes. Define the convention and namespace-exclusion rules, then verify that both attributes produce the same result for the examples and for nested namespaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100