-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly document timespan model in the api documentation.
- Loading branch information
Showing
1 changed file
with
9 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
using KDVManager.Services.Scheduling.Application.Contracts.Services; | ||
using Microsoft.AspNetCore.Authentication.JwtBearer; | ||
using Microsoft.OpenApi.Models; | ||
using Microsoft.OpenApi.Any; | ||
|
||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
|
@@ -26,6 +27,14 @@ public static IServiceCollection AddApiServices(this IServiceCollection services | |
Email = "[email protected]", | ||
}, | ||
}); | ||
|
||
// Add a custom schema filter to handle TimeSpan as string with time format | ||
options.MapType<TimeSpan>(() => new OpenApiSchema | ||
{ | ||
Type = "string", | ||
Format = "time", | ||
Example = new OpenApiString("14:30:00") | ||
}); | ||
}); | ||
|
||
services.AddHealthChecks(); | ||
|