RicoSuter/NSwag

Generated CSharp Client contains weird characters

Open

#935 opened on Sep 11, 2017

View on GitHub
 (7 comments) (0 reactions) (0 assignees)C# (1,189 forks)batch import
help wantedtype: enhancement

Repository metrics

Stars
 (6,291 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Reproduction:

Behavior: The resulting code is syntactically wrong. Line 9816 uses french quotation marks for a generic type definition:

public partial class PaginatedResult«Submission» : System.ComponentModel.INotifyPropertyChanged

Expected Behavior:

    public partial class PaginatedResult<Submission> : System.ComponentModel.INotifyPropertyChanged

Same behavior can be reproduced using the API through .net itself:

SwaggerDocument document = await SwaggerDocument.FromUrlAsync("https://ps-reg-demo.chemaxon.com/RegistryCxn/rest/api/doc");
SwaggerToCSharpClientGeneratorSettings settings = new SwaggerToCSharpClientGeneratorSettings();
SwaggerToCSharpClientGenerator generator = new SwaggerToCSharpClientGenerator(document, settings);
string code = generator.GenerateFile();

Contributor guide