To add the swagger UI to your Azure function, execute the following steps:
-
Add the nuget package Aliencube.AzureFunctions.Extensions.OpenApi.
-
Add the
OpenApiOperation
,OpenApiRequestBody
andOpenApiResponseWithBody
attributes to your Function method. -
Add the following to your local.settings.json:
"Values": { "OpenApi__Info__Version": "3.0.0", "OpenApi__Info__Title": "{Title of your function}"}
- Add the following to your host.json:
"openApi": { "info": { "version": "3.0.0", "title": "{Title of your function}", "description": "{Description}" } }