diff --git a/backend/.config/dotnet-tools.json b/backend/.config/dotnet-tools.json new file mode 100644 index 0000000..9672707 --- /dev/null +++ b/backend/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "swashbuckle.aspnetcore.cli": { + "version": "6.5.0", + "commands": [ + "swagger" + ] + } + } +} \ No newline at end of file diff --git a/backend/Program.cs b/backend/Program.cs index 8f2c269..94b3917 100644 --- a/backend/Program.cs +++ b/backend/Program.cs @@ -56,6 +56,12 @@ builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(setupAction => { + setupAction.SwaggerDoc("v1", new OpenApiInfo + { + Title = "Shypper API", + Version = "v1" + }); + setupAction.AddSecurityDefinition("ConsultaAlumnosApiBearerAuth", new OpenApiSecurityScheme() //Esto va a permitir usar swagger con el token. { Type = SecuritySchemeType.Http, @@ -83,7 +89,10 @@ if (app.Environment.IsDevelopment()) { app.UseSwagger(); - app.UseSwaggerUI(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("v1/swagger.json", "MyAPI V1"); + }); } using (var context = new UrlShortenerContext()) diff --git a/backend/url-shortener.csproj b/backend/url-shortener.csproj index 46a967f..2a0ef64 100644 --- a/backend/url-shortener.csproj +++ b/backend/url-shortener.csproj @@ -31,4 +31,13 @@ + + + + + + + + + diff --git a/backend/urls.sqlite b/backend/urls.sqlite index 52666b5..66f2eaf 100644 Binary files a/backend/urls.sqlite and b/backend/urls.sqlite differ