From e9dd1dc0e7ab18597fdfa2a1a328b70077aa2797 Mon Sep 17 00:00:00 2001 From: Cengiz Ilerler Date: Thu, 19 May 2016 23:22:33 -0400 Subject: [PATCH] added missing CLR type (byte) --- Swashbuckle.OData/Descriptions/ParameterExtensions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Swashbuckle.OData/Descriptions/ParameterExtensions.cs b/Swashbuckle.OData/Descriptions/ParameterExtensions.cs index 809603b..65ce819 100644 --- a/Swashbuckle.OData/Descriptions/ParameterExtensions.cs +++ b/Swashbuckle.OData/Descriptions/ParameterExtensions.cs @@ -68,6 +68,8 @@ public static Type GetClrType(this Parameter parameter) default: throw new Exception($"Could not determine .NET type for parameter type {type} and format 'null'"); } + case "byte": + return typeof(byte); case "int32": return typeof(int); case "int64": @@ -117,6 +119,8 @@ public static string GenerateSamplePathParameterValue(this Parameter parameter) default: throw new Exception($"Could not generate sample value for query parameter type {type} and format {"null"}"); } + case "byte": + return "254"; case "int32": case "int64": return "42"; @@ -149,4 +153,4 @@ private static Type GetEntityTypeForBodyParameter(Parameter parameter) return parameter.schema.GetReferencedType(); } } -} \ No newline at end of file +}