I am getting the Microsoft.Odata.ODataException : The DateTimeOffset text '2015-12-12T12:00' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
when I am hitting the /swagger url on my local PC.
Where is this date '2015-12-12T12:00' being picked from ? This is hapening with v3.4 and v3.5 both
I have tried to debug this but I am using VS 2017 and code contracts is supported only till VS 2015. Could you please look into this as its holding me back.
Full stack trace below
Microsoft.OData.ODataException: The DateTimeOffset text '2015-12-12T12:00' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.
at Microsoft.OData.UriUtils.ConvertUriStringToDateTimeOffset (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ExpressionLexer.TryParseDateTimeoffset (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ExpressionLexer.ParseFromDigit (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ExpressionLexer.NextTokenImplementation (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ExpressionLexer.NextToken (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.FunctionCallParser.ParseArgumentListOrEntityKeyList (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.SegmentArgumentParser.TryParseFromUri (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.SegmentKeyHandler.TryCreateKeySegmentFromParentheses (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataPathParser.TryBindKeyFromParentheses (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataPathParser.TryCreateSegmentForNavigationSource (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataPathParser.ParsePath (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataPathFactory.BindPath (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataUriParser.ParsePathImplementation (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.OData.UriParser.ODataUriParser.Initialize (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.OData.Routing.DefaultODataPathHandler.Parse (System.Web.OData, Version=6.1.0.10907, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Web.OData.Routing.DefaultODataPathHandler.Parse (System.Web.OData, Version=6.1.0.10907, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GenerateSampleODataPath (SwaggerRouteStrategy.cs:162) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.CreateHttpRequestMessage (SwaggerRouteStrategy.cs:94) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GetActionDescriptors (SwaggerRouteStrategy.cs:67) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GetActionDescriptors (SwaggerRouteStrategy.cs:51) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy+<>cDisplayClass3_0.b1 (SwaggerRouteStrategy.cs:41) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at System.Linq.Enumerable+d162.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Linq.Enumerable+<SelectManyIterator>d__162.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Linq.Enumerable+d63`1.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Linq.Enumerable+d162.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Collections.Generic.List1..ctor (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Linq.Enumerable.ToList (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Swashbuckle.OData.CollectionExtentions.ToCollection (CollectionExtentions.cs:77) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.Descriptions.ODataApiExplorer.GetApiDescriptions (ODataApiExplorer.cs:43) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at System.Lazy1.CreateValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy1.LazyInitValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Lazy`1.get_Value (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Swashbuckle.OData.Descriptions.ODataApiExplorer.get_ApiDescriptions (ODataApiExplorer.cs:39) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.ODataSwaggerProvider.GetApiDescriptionsFor (ODataSwaggerProvider.cs:319) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.ODataSwaggerProvider.GenerateSwagger (ODataSwaggerProvider.cs:79) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.OData.ODataSwaggerProvider+<>c__DisplayClass4_0.b1 (ODataSwaggerProvider.cs:50) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at System.Lazy1.CreateValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy1.LazyInitValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Lazy`1.get_Value (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at Swashbuckle.OData.ODataSwaggerProvider.GetSwagger (ODataSwaggerProvider.cs:53) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at Swashbuckle.Application.SwaggerDocsHandler.SendAsync (Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc)
at System.Net.Http.HttpMessageInvoker.SendAsync (System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync (System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Net.Http.DelegatingHandler.SendAsync (System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
at System.Web.Http.HttpServer+d__0.MoveNext (System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
Hi,
I am getting the Microsoft.Odata.ODataException : The DateTimeOffset text '2015-12-12T12:00' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range. when I am hitting the /swagger url on my local PC.
Where is this date '2015-12-12T12:00' being picked from ? This is hapening with v3.4 and v3.5 both
I have tried to debug this but I am using VS 2017 and code contracts is supported only till VS 2015. Could you please look into this as its holding me back.
Full stack trace below
Microsoft.OData.ODataException: The DateTimeOffset text '2015-12-12T12:00' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range. at Microsoft.OData.UriUtils.ConvertUriStringToDateTimeOffset (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ExpressionLexer.TryParseDateTimeoffset (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ExpressionLexer.ParseFromDigit (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ExpressionLexer.NextTokenImplementation (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ExpressionLexer.NextToken (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.FunctionCallParser.ParseArgumentListOrEntityKeyList (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.SegmentArgumentParser.TryParseFromUri (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.SegmentKeyHandler.TryCreateKeySegmentFromParentheses (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataPathParser.TryBindKeyFromParentheses (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataPathParser.TryCreateSegmentForNavigationSource (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataPathParser.CreateFirstSegment (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataPathParser.ParsePath (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataPathFactory.BindPath (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataUriParser.ParsePathImplementation (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Microsoft.OData.UriParser.ODataUriParser.Initialize (Microsoft.OData.Core, Version=7.3.1.10814, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Web.OData.Routing.DefaultODataPathHandler.Parse (System.Web.OData, Version=6.1.0.10907, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Web.OData.Routing.DefaultODataPathHandler.Parse (System.Web.OData, Version=6.1.0.10907, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GenerateSampleODataPath (SwaggerRouteStrategy.cs:162) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.CreateHttpRequestMessage (SwaggerRouteStrategy.cs:94) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GetActionDescriptors (SwaggerRouteStrategy.cs:67) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy.GetActionDescriptors (SwaggerRouteStrategy.cs:51) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.Descriptions.SwaggerRouteStrategy+<>cDisplayClass3_0.b1 (SwaggerRouteStrategy.cs:41) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at System.Linq.Enumerable+d 16d63`1.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
at System.Linq.Enumerable+d 16b 1 (ODataSwaggerProvider.cs:50) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959)
at System.Lazyd__0.MoveNext (System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
2.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Linq.Enumerable+<SelectManyIterator>d__16
2.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Linq.Enumerable+2.MoveNext (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Collections.Generic.List
1..ctor (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Linq.Enumerable.ToList (System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Swashbuckle.OData.CollectionExtentions.ToCollection (CollectionExtentions.cs:77) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.Descriptions.ODataApiExplorer.GetApiDescriptions (ODataApiExplorer.cs:43) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at System.Lazy1.CreateValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy
1.LazyInitValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy`1.get_Value (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Swashbuckle.OData.Descriptions.ODataApiExplorer.get_ApiDescriptions (ODataApiExplorer.cs:39) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.ODataSwaggerProvider.GetApiDescriptionsFor (ODataSwaggerProvider.cs:319) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.ODataSwaggerProvider.GenerateSwagger (ODataSwaggerProvider.cs:79) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.OData.ODataSwaggerProvider+<>c__DisplayClass4_0.1.CreateValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy
1.LazyInitValue (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Lazy`1.get_Value (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Swashbuckle.OData.ODataSwaggerProvider.GetSwagger (ODataSwaggerProvider.cs:53) (Swashbuckle.OData, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a2e252c86e553959) at Swashbuckle.Application.SwaggerDocsHandler.SendAsync (Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc) at System.Net.Http.HttpMessageInvoker.SendAsync (System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync (System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Net.Http.DelegatingHandler.SendAsync (System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.Http.HttpServer+