forked from ddrilling/AsbCloudServer
Добавил маппинг JsonValue в конфигурацию сваггера
This commit is contained in:
parent
4cb42c9f72
commit
4d52a9b89f
@ -1,4 +1,5 @@
|
|||||||
using AsbCloudInfrastructure.Services;
|
using AsbCloudApp.Data.GTR;
|
||||||
|
using AsbCloudInfrastructure.Services;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
@ -18,6 +19,15 @@ namespace AsbCloudWebApi
|
|||||||
services.AddSwaggerGen(c =>
|
services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
c.MapType<DateOnly>(() => new OpenApiSchema { Type = "string", Format = "date" });
|
c.MapType<DateOnly>(() => new OpenApiSchema { Type = "string", Format = "date" });
|
||||||
|
c.MapType<JsonValue>(() => new OpenApiSchema {
|
||||||
|
AnyOf = new OpenApiSchema[]
|
||||||
|
{
|
||||||
|
new OpenApiSchema {Type = "string", Format = "string" },
|
||||||
|
new OpenApiSchema {Type = "number", Format = "int32" },
|
||||||
|
new OpenApiSchema {Type = "number", Format = "float" },
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
c.CustomOperationIds(e =>
|
c.CustomOperationIds(e =>
|
||||||
{
|
{
|
||||||
return $"{e.ActionDescriptor.RouteValues["action"]}";
|
return $"{e.ActionDescriptor.RouteValues["action"]}";
|
||||||
|
Loading…
Reference in New Issue
Block a user