Base solution for your next web application
Open Closed

NSwag creates camelcase models #6771


User avatar
0
antonis created

I have noticed that nswag refresh script creates camelcase models on angular ts. On server I have the following model

public class Client
{
    public string Name {get;set;}
    public DateTime DateOfBirth {get;set;}
}

in angular I get the following

 name!: string | undefined;
    dateOfBirth!: string | undefined;

How do I force it to keep the same names?

Thanks


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    The return json format of your backend should be camelcase. So NSwag also uses the same format.

  • User Avatar
    0
    antonis created

    how do I override it for nswag?

  • User Avatar
    0
    maliming created
    Support Team

    see: https://github.com/RicoSuter/NSwag/issues/1809#issuecomment-445862544

  • User Avatar
    0
    antonis created

    Thanks