Azure / Azure/azure-functions-openapi-extension

Support "catch all" http trigger route

Open
#70 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

Writing 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

```csharp
[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

![image](https://user-images.githubusercontent.com/1356444/111282780-b3c70580-8681-11eb-8c97-932852c4f3fa.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.