Azure / azure-functions-openapi-extension

This extension provides an Azure Functions app with Open API capability for better discoverability to consuming parties
https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.OpenApi/
MIT License
367 stars 192 forks source link

New Feature: Expose UI endpoints to APIM by devs' choice #403

Open justinyoo opened 2 years ago

justinyoo commented 2 years ago

Curerntly, 4 UI-related endpoints are not exposed to the OpenAPI document:

There are cases that devs want to expose those endpoints through Azure APIM. In that case, they have to manually add them. To reduce this manual efforts, this feature would be useful:

  1. Add the environment variable OpenApi__ExposeUI – its value will be false by default. If it's set to true, all four UI-related endpoints should be accessible through APIM.
  2. Add the querystring parameter exposeui – itsvalue will be false by default. If it's set to true, all four UI-related endpoints should be accessible through APIM. In addition to that, this querystring parameter should take precedense to the environment variable.

Update: 2022-03-29

There have already been options – OpenApi__HideSwaggerUI and OpenApi__HideDocument that are applicable on the function app levels. To avoid providing dev with misleading information, the environment variable names might be changed.

Pikabanga commented 2 years ago

It might be useful to have a bit more granularity, say I only want to expose the specification files (/swagger.{extension} and /openapi/{version}.{extension}), but not the UI for example.

justinyoo commented 2 years ago

@Pikabanga To be clear, there have already been two options – OpenApi__HideSwaggerUI and OpenApi__HideDocument that are applicable on the function app levels.

This feature is only applicable for services in front of the function apps like API Management, Front Door, etc.