Notice that the "hydra:member" property has both id and @id, when using the NSwag to generate a CsharpClient, it will make those property into the same variable name:
[System.Text.Json.Serialization.JsonPropertyName("@id")]
public int Id { get; set; }
[System.Text.Json.Serialization.JsonPropertyName("id")]
public string Id { get; set; }
NOTE: this is not specifically for Id, there are some properties also that has @ at the beginning.
Is there a way to rename those variables that has @ on their names, for example the @Id will rename the variable to KeyId or StringId. I'm currently using NSwag.MSBuild but open to code level generation if needed.
I got a bit weird swagger.spec from other developer which mainly has 2 variable that uses similar name but with @ at the start. to give an example:
You can also copy and paste the yaml and paste it here https://editor.swagger.io/
Notice that the "hydra:member" property has both id and @id, when using the NSwag to generate a CsharpClient, it will make those property into the same variable name:
NOTE: this is not specifically for Id, there are some properties also that has @ at the beginning.
Is there a way to rename those variables that has @ on their names, for example the @Id will rename the variable to KeyId or StringId. I'm currently using NSwag.MSBuild but open to code level generation if needed.