question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The generator Inferface for angular are PascalCase and not camelCase

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Andermancommented, Apr 5, 2018

Thx

0reactions
RicoSutercommented, Apr 5, 2018

Please update the wiki if this information is missing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found