The generator Inferface for angular are PascalCase and not camelCase
See original GitHub issueThe generator interface is PascalCase
export interface ConflictInfo {
ReadyToUpdate?: IntusPlanning[] | null;
ReadyToDelete?: IntusPlanning[] | null;
NewForUpdate?: IntusPlanning[] | null;
Updates: number;
Deletes: number;
}
But net core use camelCase for json output. I tried some settings in mine .nswag file. But this doesnot seems to work.
{
"runtime": "NetCore20",
"swaggerGenerator": {
"webApiToSwagger": {
"controllerNames": [],
"isAspNetCore": true,
"defaultUrlTemplate": "api/{controller}/{id?}",
"defaultPropertyNameHandling": "CamelCase",
"defaultReferenceTypeNullHandling": "Null",
"defaultEnumHandling": "Integer",
"flattenInheritanceHierarchy": false,
"generateKnownTypes": true,
"generateXmlObjects": false,
"generateAbstractProperties": false,
"addMissingPathParameters": false,
"ignoreObsoleteProperties": false,
"allowReferencesWithProperties": false,
"excludedTypeNames": [],
"output": null,
"assemblyPaths": [
"bin/Debug/netcoreapp2.0/Itzos.Vvt.Web.dll"
],
"referencePaths": [
"%USERPROFILE%/.nuget/packages"
]
}
},
"codeGenerators": {
"swaggerToTypeScriptClient": {
"PropertyNameHandling" : "CamelCase",
"DefaultPropertyNameHandling" : "CamelCase",
"className": "{controller}Client",
"moduleName": "",
"namespace": "",
"typeScriptVersion": 2.7,
"template": "Angular",
"promiseType": "Promise",
"httpClass": "HttpClient",
"injectionTokenType": "InjectionToken",
"dateTimeType": "Date",
"nullValue": "Null",
"generateClientClasses": true,
"generateClientInterfaces": false,
"generateOptionalParameters": false,
"wrapDtoExceptions": false,
"wrapResponses": false,
"generateResponseClasses": true,
"responseClass": "SwaggerResponse",
"useTransformOptionsMethod": false,
"useTransformResultMethod": false,
"generateDtoTypes": true,
"operationGenerationMode": "MultipleClientsFromOperationId",
"markOptionalProperties": true,
"generateCloneMethod": false,
"typeStyle": "Interface",
"generateDefaultValues": false,
"excludedTypeNames": [],
"handleReferences": false,
"generateConstructorInterface": true,
"convertConstructorInterfaceData": false,
"importRequiredTypes": true,
"useGetBaseUrlMethod": false,
"baseUrlTokenName": "API_BASE_URL",
"queryNullValue": "",
"output": "../../my-app/src/app/services/backend.service.ts"
}
}
}
I also tried to change the startup.cs
app.UseSwaggerUi(typeof(Startup).GetTypeInfo().Assembly, new SwaggerUiSettings
{
DefaultPropertyNameHandling = PropertyNameHandling.CamelCase
});
Is there a way to use camel case in my generated output??
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
The generator Inferface for angular are PascalCase and ...
The generator interface is PascalCase export interface ... The generator Inferface for angular are PascalCase and not camelCase #1258.
Read more >Typescript interface properties are changed to Pascal Case ...
I am using Angular 1.4 with type script, and RXJS in an ASP.NET 5 application. I am having extremly wiered issue. During the...
Read more >Angular coding style guide
Looking for an opinionated guide to Angular syntax, conventions, and application structure? Step right in. This style guide presents preferred conventions ...
Read more >Documentation for the typescript-angular Generator
generator name, typescript-angular, pass this to the generate command ... Naming convention for enum properties: 'camelCase', 'PascalCase', ...
Read more >StyleGuide · typescript-book - Hamed Nourhani
Variable; Class; Interface; Type; Namespace; Enum; null vs. undefined ... Use camelCase for variable and function names ... Use PascalCase for name.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thx
Please update the wiki if this information is missing.