Open marcwittke opened 7 years ago
They are coming from the names in the swagger spec - you can fix this with an own CSharpGeneratorSettings.TypeNameGenerator
and we should probably fix the default one for this scenario:
https://github.com/RSuter/NJsonSchema/blob/master/src/NJsonSchema/DefaultTypeNameGenerator.cs
Wow, you're right, didn't came to my mind that this might be valid JSON. However, I've to provide an implementation of the enum name generator as well, I noticed:
public enum SearchConditionOperator
{
[System.Runtime.Serialization.EnumMember(Value = "=")]
= = 0,
[System.Runtime.Serialization.EnumMember(Value = "<>")]
<> = 1,
[System.Runtime.Serialization.EnumMember(Value = "<")]
< = 2,
[System.Runtime.Serialization.EnumMember(Value = ">")]
> = 3,
CSharp doesn't like these enum members, surprisingly...
Maybe we should enhance the DefaultEnumGenerator too so that no wrong C# or TypeScript code can be generated - there is no reason to not change it as it would always output wrong for specs like yours...
Same problem with the JIRA API. How could this be fixed? Is there possibly a configuration parameter to replace invalid chars from enum values?
I have the same problem. In the class name «
I have the same problem. In the class name «
@borgez did you find a way to resolve your issue with « (french quotation mark)?
Needs to be fixed here: https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema.CodeGeneration/DefaultEnumNameGenerator.cs
Either by changing the default impl or by providing an own one... Please create a PR with tests.
Reproduction:
Behavior: The resulting code is syntactically wrong. Line 9816 uses french quotation marks for a generic type definition:
Expected Behavior:
Same behavior can be reproduced using the API through .net itself: