Open sahin52 opened 1 year ago
Oops, after research, I saw that it is related to camelCase option. But there is no option to not remove underscore in camelCase. But if I don't use camelCase, the generated types will start with upper case. I may close this issue, but I still want a way to make attributes start with lower case and preserve the underscore.
Created this pull request: https://github.com/svenheden/csharp-models-to-typescript/pull/67 which will solve this problem. If you have the same problem, you can add a config like this after using this pull request:
{
"lowerFirstLetters": true,
"include": [
"C:\\X\\Y\\Z\\**\\*.cs"
],
"exclude": [
],
"namespace": "\"Api\"",
"output": ".\\types.d.ts",
"camelCase": false,
"camelCaseEnums": true,
"numericEnums": true,
"stringLiteralTypesInsteadOfEnums": false,
"customTypeTranslations": {
"char": "string"
}
}
is converted to this:
As you see, the underscore is not correctly handled in class attributes, it is removed, but it is correctly handled in enums. my config is like this:
I'd love to try to solve this problem, if you would merge it to the project.