Skip to content

Commit

Permalink
Map System.Net.IPNetwork to string, cidr format in OpenAPI/Swagger (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored May 9, 2024
1 parent 4149377 commit 21c7b89
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public static SwaggerGenOptions MapFrameworkTypes(this SwaggerGenOptions options
{
options.MapType<TimeSpan>(() => new OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-span", });
options.MapType<System.Net.IPAddress>(() => new OpenApi.Models.OpenApiSchema { Type = "string", Format = "ip-address", });
options.MapType<System.Net.IPNetwork>(() => new OpenApi.Models.OpenApiSchema { Type = "string", Format = "cidr", });
options.MapType<System.Text.Json.Nodes.JsonNode>(() => new OpenApi.Models.OpenApiSchema { });
options.MapType<System.Text.Json.Nodes.JsonObject>(() => new OpenApi.Models.OpenApiSchema { Type = "object", AdditionalProperties = new OpenApi.Models.OpenApiSchema(), });
options.MapType<System.Text.Json.Nodes.JsonArray>(() => new OpenApi.Models.OpenApiSchema { Type = "array", });
Expand Down

0 comments on commit 21c7b89

Please sign in to comment.