Hello 👋🏼 colleague @Li Shen
To enable OpenAPI v3 in Azure Function isolated model with .NET 8.0, you can use the Swashbuckle.AspNetCore NuGet package.
Here are the steps to achieve this:
- Add the Swashbuckle.AspNetCore NuGet package to your project.
- In your Startup.cs file, add the following code to the ConfigureServices method:
services.AddSwaggerGen(c => { c.SwaggerDoc("v1",
new OpenApiInfo { Title = "My API", Version = "v1" }); });
- In the Configure method, add the following code:
app.UseSwagger();
app.UseSwaggerUI(c => {
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
});
- Build and run your project. This will enable OpenAPI v3 in your Azure Function isolated model with .NET 8.0. If you have any further questions, you know how to reach me.