ButterCMS / buttercms-csharp

.NET API client for ButterCMS (https://buttercms.com)
MIT License
40 stars 16 forks source link

Apply SnakeCaseContractResolver on deserializing pages #21

Closed criteo-contractor-1 closed 1 year ago

criteo-contractor-1 commented 4 years ago

This model used in the tests

public class TeamMembersHeadline
{
    public Team_Members[] team_members { get; set; }
    public string homepage_headline { get; set; }
}

should read

public class TeamMembersHeadline
{
    public TeamMembers[] team_members { get; set; }
    public string HomepageHeadline { get; set; }
}

with the default csharp naming convention.

Fix to be performed in RetrievePageAsync<T>. If you're afraid of breaking changes, a different method or overload could be created or, at the very least a RetrievePageJsonAsync. Even if you do implement RetrievePageJsonAsync, I strongly recommend adding one of the other options as a built-in way to deserialize without having to use weird naming or attributes.

jakelumetta commented 4 years ago

Thanks @criteo-contractor-1 - we will review

jakelumetta commented 4 years ago

@criteo-contractor-1 please let us know your thoughts on: https://github.com/ButterCMS/buttercms-csharp/pull/22

jakelumetta commented 1 year ago

@criteo-contractor-1 following up on this