You can use attributes (in java annotations).
e.g. for Json:
const string JSON = @"{ ""name"": ""xyz-class"" }";
// from json to object
Xyz? xyz = JsonSerializer.Deserialize<Xyz>(JSON);
// from object to json
string jsonString = JsonSerializer.Serialize(xyz);
class Xyz
{
// hint: the suffix Attribute is optional
[JsonPropertyName("name")] // mapping
public string Name {get; set;}
}