Skip to content

Kiota dose not generate code for Etsy OpenAPI. #1265

@CoolIOT

Description

@CoolIOT

Kiota dose not generate code for Etsy OpenAPI.

To reproduce the bug.

  1. Copy the link https://www.etsy.com/openapi/generated/oas/3.0.0.json
  2. Go to Swagger Editor and click on File Then Import URL
  3. Paste the URL in the prompt and cick OK
  4. Save the generated yaml in a file Ex: Etsy.yaml
  5. Clone the repo and Execute kiota with this command line argument: generate -d (path/to/your/Etsy.yaml) -o generated -l CSharp

Got this Exception:

crit: Kiota.Builder.KiotaBuilder[0]
      error generating the client: Value was either too large or too small for a Decimal.
      System.OverflowException: Value was either too large or too small for a Decimal.
         at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
         at System.Decimal.Parse(String s, NumberStyles style, IFormatProvider provider)
         at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_180(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_200(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.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_81(OpenApiMediaType 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.LoadMediaType(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_164(OpenApiRequestBody 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.LoadRequestBody(ParseNode node)
         at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_112(OpenApiOperation 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.LoadOperation(ParseNode node)
         at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_149(OpenApiPathItem 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.LoadPathItem(ParseNode node)
         at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_160(OpenApiPaths o, String k, 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.LoadPaths(ParseNode node)
         at Microsoft.OpenApi.Readers.V3.OpenApiV3Deserializer.<>c.<.cctor>b__102_25(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.ReadAsync(YamlDocument input, CancellationToken cancellationToken)
         at Microsoft.OpenApi.Readers.OpenApiTextReaderReader.ReadAsync(TextReader input, CancellationToken cancellationToken)
         at Kiota.Builder.KiotaBuilder.<>c__DisplayClass27_0.<<CreateOpenApiDocumentAsync>g__ReadAsync|0>d.MoveNext() in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 457
      --- End of stack trace from previous location ---
         at Kiota.Builder.KiotaBuilder.CreateOpenApiDocumentAsync(Stream input, Boolean generating, CancellationToken cancellationToken) in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 419
         at Kiota.Builder.KiotaBuilder.GetTreeNodeInternal(String inputPath, Boolean generating, Stopwatch sw, CancellationToken cancellationToken) in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 94
         at Kiota.Builder.KiotaBuilder.GetTreeNodeInternal(String inputPath, Boolean generating, Stopwatch sw, CancellationToken cancellationToken) in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 130
         at Kiota.Builder.KiotaBuilder.GenerateClientAsync(CancellationToken cancellationToken) in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 193
         at Kiota.Builder.KiotaBuilder.GenerateClientAsync(CancellationToken cancellationToken) in D:\_POC\Kiota\kiota\src\Kiota.Builder\KiotaBuilder.cs:line 223
         at kiota.Handlers.KiotaGenerationCommandHandler.InvokeAsync(InvocationContext context) in D:\_POC\Kiota\kiota\src\kiota\Handlers\KiotaGenerationCommandHandler.cs:line 123

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions