Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I added OpenApi support to an Azure functions application (v3), using .ConfigureOpenApi() in Program.Main(). I use function decorations for the specific functions but how can I control the general API name, version etc, shown on ~/api/swagger/ui ?

Here is my Program.Main() code:



public static void Main()
       {

           var host = new HostBuilder()
               .ConfigureFunctionsWorkerDefaults(worker => worker.UseNewtonsoftJson())
               .ConfigureOpenApi()
               .ConfigureServices(services =>
                   {
                       services.AddLogging();
                   }
               )
               .Build();

           host.Run();
       }
   }


What I have tried:

I Can write it in YAML manually but I need is generating OpenAPI (includes metadata like API Name, Version etc) from the code
Posted
Updated 8-Oct-21 18:47pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900