azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
Endpoints displayed in random order
Using Microsoft.Azure.Functions.Worker.Extensions.OpenApi Version="0.8.1-preview"
The swagger ui lists the functions/endpoints in a random order. It is not sorting by tag name or by function name.
The corresponding swagger.json is also unsorted.
Functions are grouping properly by tags but not sorting within the tag groups either.
Cannot upgrade to 1.0.0 due to issue #296
The expected behavior is that functions are sorted by Tag then by Function Name/OperationId.
The current behavior seems to be a random order by Tag then ordered by order of method within source code.
For example:
[OpenApiOperation(operationId: "FunctionA", tags: new[] { "Function Group A" }]
public async Task<HttpResponseData> postFunctionA([HttpTrigger(AuthorizationLevel.Function, "post"] HttpRequestData req, FunctionContext executionContext)
{
...
}
[OpenApiOperation(operationId: "FunctionC", tags: new[] { "Function Group B" }]
public async Task<HttpResponseData> postFunctionC([HttpTrigger(AuthorizationLevel.Function, "post"] HttpRequestData req, FunctionContext executionContext)
{
///
}
[OpenApiOperation(operationId: "FunctionB", tags: new[] { "Function Group B" }]
public async Task<HttpResponseData> postFunctionB([HttpTrigger(AuthorizationLevel.Function, "post"] HttpRequestData req, FunctionContext executionContext)
{
///
}
The above should render as:
Function Group A -postFunctionA
Function Group B -postFunctionB -postFunctionC
Instead it will render as:
Function Group B -postFunctionC -postFunctionB
Function Group A -postFunctionA
Was there ever a resolution to this issue? Looking to figure out how to order the endpoints displayed in swagger UI
I would also like to order the endpoints by tags. I know you can modify the stylesheet or add custom javascript to the ui generation, but it seems I little hacky. I think there should be a more straight forward way to order the endpoints by tag, or at least by default order tags alphabetically.
Nothing here? I have the same problem.
Same here. Please can someone investigate and fix please!
I'm using 1.5.1
of the NuGet Package.