Support "catch all" http trigger route
See original GitHub issueWriting a route like {*path}
and {**path}
to get all subsequent path parameters did not correctly output the OpenAPI definition.
Microsoft.Azure.WebJobs.Extensions.OpenApi
: 0.5.1-preview
Repro code
[FunctionName("CatchAll")]
[OpenApiOperation(operationId: "CatchAll", tags: new[] { "name" })]
[OpenApiParameter("path", In = ParameterLocation.Path, Type = typeof(string))]
[OpenApiResponseWithoutBody(HttpStatusCode.OK)]
public static ActionResult CatchAll([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "catchall/{*path}")]
HttpRequest req,
string path)
{
return new OkObjectResult(path);
}
Actual behavior
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to create a HttpTrigger that will match any url?
I have discovered you can match anything with a * at the start of the parameter name Route = "{*any}" will match any...
Read more >Azure Functions HTTP trigger
The HTTP trigger lets you invoke a function with an HTTP request. ... "get", "post", Route = null)] HttpRequest req, ILogger log) {...
Read more >Azure Functions: Wildcard Routing
A quick tip to support wildcard routes in Azure Functions. ... What you need is a way to set up a wildcard route...
Read more >Azure Functions HTTP triggers and bindings overview
Learn to use HTTP triggers and bindings in Azure Functions. ... routePrefix, api, The route prefix that applies to all routes.
Read more >Customize default route on domain root level #848
If the function gets triggered via the default route on domain root ... can define a route that matches the root without using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@justinyoo
I tried the same route with the ASP.NET Core Web API with Swashbuckle, and it worked. Looking at the generated openapi definition, it seems that “*” should not be included in the definition.
@shibayan Yeah, it’s not something I can do on my end. If you Google it, there are so many discussions around - from the spec wise to the implementation perspective.
I’m not too sure, we can get it through the
proxies.json
file. Let me try.