Repository navigation
Closed
Description
When a json or yaml file has minimum or maximum values specified in E Notation
e.g.
type: integer
format: int64
maximum: 9.2233720368547799E+18
minimum: 1
When I try to import this into Azure APIM, which I believe its using this library to parse the yaml.
When I try using OpenApiStreamReader to read the yaml file, it crashes with FormatException "input string was not in a correct format".
Stack Trace:
at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
at System.Decimal.Parse(String s, IFormatProvider provider)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_177(OpenApiSchema o, ParseNode n)
at Microsoft.OpenApi.Readers.ParseNodes.PropertyNode.ParseField[T](T parentInstance, IDictionary`2 fixedFields, IDictionary`2 patternFields)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.LoadSchema(ParseNode node)
at Microsoft.OpenApi.Readers.ParseNodes.MapNode.<>c__DisplayClass6_0`1.<CreateMap>b__0(KeyValuePair`2 n)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Microsoft.OpenApi.Readers.ParseNodes.MapNode.CreateMap[T](Func`2 map)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_197(OpenApiSchema o, ParseNode n)
at Microsoft.OpenApi.Readers.ParseNodes.PropertyNode.ParseField[T](T parentInstance, IDictionary`2 fixedFields, IDictionary`2 patternFields)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.LoadSchema(ParseNode node)
at Microsoft.OpenApi.Readers.ParseNodes.MapNode.<>c__DisplayClass7_0`1.<CreateMapWithReference>b__0(KeyValuePair`2 n)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
at Microsoft.OpenApi.Readers.ParseNodes.MapNode.CreateMapWithReference[T](ReferenceType referenceType, Func`2 map)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_4(OpenApiComponents o, ParseNode n)
at Microsoft.OpenApi.Readers.ParseNodes.PropertyNode.ParseField[T](T parentInstance, IDictionary`2 fixedFields, IDictionary`2 patternFields)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.ParseMap[T](MapNode mapNode, T domainObject, FixedFieldMap`1 fixedFieldMap, PatternFieldMap`1 patternFieldMap)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.LoadComponents(ParseNode node)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_26(OpenApiDocument o, ParseNode n)
at Microsoft.OpenApi.Readers.ParseNodes.PropertyNode.ParseField[T](T parentInstance, IDictionary`2 fixedFields, IDictionary`2 patternFields)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.ParseMap[T](MapNode mapNode, T domainObject, FixedFieldMap`1 fixedFieldMap, PatternFieldMap`1 patternFieldMap)
at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.LoadOpenApi(RootNode rootNode)
at Microsoft.OpenApi.Readers.V3.OpenApiV3VersionService.LoadDocument(RootNode rootNode)
at Microsoft.OpenApi.Readers.ParsingContext.Parse(YamlDocument yamlDocument)
at Microsoft.OpenApi.Readers.OpenApiYamlDocumentReader.Read(YamlDocument input, OpenApiDiagnostic& diagnostic)
at Microsoft.OpenApi.Readers.OpenApiTextReaderReader.Read(TextReader input, OpenApiDiagnostic& diagnostic)
at Microsoft.OpenApi.Readers.OpenApiStreamReader.Read(Stream input, OpenApiDiagnostic& diagnostic)
It looks like this has been "fixed" in the code as it uses NumberStyles.Float, but in the non-preview nuget release it is still broken.
Metadata
Metadata
Assignees
Labels
No labels
Activity
darrelmiller commentedon Mar 26, 2022
Apologies for the delay in getting 1.3 released. Getting the external references working has taken a lot longer than expected. I'm working on that right now. Hopefully within a couple of weeks we will have the release out.
darrelmiller commentedon Mar 29, 2022
All the issues on 1.3 have been resolved. We are just testing before release.