Check out example codes for "swaggergen add service not getting info in .net core". It will help you in understanding the concepts better.
Code Example 1
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "The API", Version = "v1" });
});
Code Example 2
using Microsoft.OpenApi.Models;
Learn ReactJs, React Native from akashmittal.com