You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I run the command I get the following error:
Error: While scanning a multi-line double-quoted scalar, found wrong indentation. Exception: YamlDotNet.Core.SyntaxErrorException Stack Trace: at YamlDotNet.Core.Scanner.ScanFlowScalar(Boolean isSingleQuoted) at YamlDotNet.Core.Scanner.FetchQuotedScalar(Boolean isSingleQuoted) at YamlDotNet.Core.Scanner.FetchNextToken() at YamlDotNet.Core.Scanner.FetchMoreTokens() at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming() at YamlDotNet.Core.Parser.GetCurrentToken() at YamlDotNet.Core.Parser.ParseBlockMappingValue() at YamlDotNet.Core.Parser.MoveNext() .... at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type) at NSwag.OpenApiYamlDocument.FromYamlAsync(String data, String documentPath, SchemaType expectedSchemaType, Func_2 referenceResolverFactory, CancellationToken cancellationToken) at Refitter.Core.OpenApiDocumentFactory.CreateUsingNSwagAsync(String openApiPath) in /_/src/Refitter.Core/OpenApiDocumentFactory.cs:line 50 at Refitter.Core.OpenApiDocumentFactory.CreateAsync(String openApiPath) in /_/src/Refitter.Core/OpenApiDocumentFactory.cs:line 41 at Refitter.Core.RefitGenerator.GetOpenApiDocument(RefitGeneratorSettings settings) in /_/src/Refitter.Core/RefitGenerator.cs:line 35 at Refitter.Core.RefitGenerator.CreateAsync(RefitGeneratorSettings settings) in /_/src/Refitter.Core/RefitGenerator.cs:line 19 at Refitter.GenerateCommand.ExecuteAsync(CommandContext context, Settings settings) in /_/src/Refitter/GenerateCommand.cs:line 45
Additional context
I am new to all of this, so it is very possible I just did something stupid myself. And the OpenApi document was not generated by myself, but by another company, so maybe there is something wrong there. I am just not able to figure out what this issue is and would appreciate the help.
The text was updated successfully, but these errors were encountered:
@eriksteinebach I couldn't get the linked OpenAPI specifications to work as is, but when I re-format it to use single quotes with https://jsonformatter.org/yaml-validator then Refitter stopped complaining and was able to generate code
Here a zip file containing both the re-formatted YAML file and the Refitter output file Archive.zip
I use NSwag for parsing the OpenAPI specifications document, and it seems that the library doesn't like the OpenAPI specifications that you shared
There is not much I can do about that, and since there's an easy workaround I don't think I'll spend time investigating how the problem in the NSwag code base either
@christianhelle thank you for looking into this. With a couple of other small tweaks I was able to generate the interface, so I think it works. Yes, it looks like more a problem in NSwag. But I can continue for now, so I will leave this be as well.
Describe the bug
I am trying to generate a client with the following command:
refitter "https://docs.contentcontroller.com/automation-api/v1/cc-public-api.yml" --skip-validation --namepsace "Rustici.GeneratedCode"
When I use the following tool: https://onlineyamltools.com/validate-yaml to validate the yaml, everything seems valid.
But when I run the command I get the following error:
Error: While scanning a multi-line double-quoted scalar, found wrong indentation. Exception: YamlDotNet.Core.SyntaxErrorException Stack Trace: at YamlDotNet.Core.Scanner.ScanFlowScalar(Boolean isSingleQuoted) at YamlDotNet.Core.Scanner.FetchQuotedScalar(Boolean isSingleQuoted) at YamlDotNet.Core.Scanner.FetchNextToken() at YamlDotNet.Core.Scanner.FetchMoreTokens() at YamlDotNet.Core.Scanner.MoveNextWithoutConsuming() at YamlDotNet.Core.Parser.GetCurrentToken() at YamlDotNet.Core.Parser.ParseBlockMappingValue() at YamlDotNet.Core.Parser.MoveNext() .... at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type) at NSwag.OpenApiYamlDocument.FromYamlAsync(String data, String documentPath, SchemaType expectedSchemaType, Func_2 referenceResolverFactory, CancellationToken cancellationToken) at Refitter.Core.OpenApiDocumentFactory.CreateUsingNSwagAsync(String openApiPath) in /_/src/Refitter.Core/OpenApiDocumentFactory.cs:line 50 at Refitter.Core.OpenApiDocumentFactory.CreateAsync(String openApiPath) in /_/src/Refitter.Core/OpenApiDocumentFactory.cs:line 41 at Refitter.Core.RefitGenerator.GetOpenApiDocument(RefitGeneratorSettings settings) in /_/src/Refitter.Core/RefitGenerator.cs:line 35 at Refitter.Core.RefitGenerator.CreateAsync(RefitGeneratorSettings settings) in /_/src/Refitter.Core/RefitGenerator.cs:line 19 at Refitter.GenerateCommand.ExecuteAsync(CommandContext context, Settings settings) in /_/src/Refitter/GenerateCommand.cs:line 45
Support Key:
tb7axxy
OpenAPI Specifications
https://docs.contentcontroller.com/automation-api/v1/cc-public-api.yml
Additional context
I am new to all of this, so it is very possible I just did something stupid myself. And the OpenApi document was not generated by myself, but by another company, so maybe there is something wrong there. I am just not able to figure out what this issue is and would appreciate the help.
The text was updated successfully, but these errors were encountered: