ngocnicholas / airtable.net

Airtable .NET API Client
MIT License
138 stars 34 forks source link

v 1.2.0 breaking changes #69

Closed TiagoBrenck closed 1 year ago

TiagoBrenck commented 1 year ago

Hi,

I noticed that updating my nuget package from 1.1.5 to 1.2.0 resulted in null values when binding columns to properties that dont match their capital letters. Also, the type DateTime is not able to be parsed anymore.

For example, given the model

    public class AirtableModel
    {
        public string UserName { get; set; }
        public DateTime? FooDate { get;set; }
    }

And Airtable

| username | FooDate            |
|-----------|---------------------|
| John Doe  | 2023-02-17 12:00:00 |
| Mary Anne | 2023-02-17 09:00:00 |

Then calling the ListRecords<T>:

var result = await airtableBase.ListRecords<AirtableModel>("MyTable", view: "MyView");

You will get a JSON parse error for the FooDate field. Commenting that field in the model and running the same code, gives you results but with UserName as null.

Downgrade to v.1.1.5 and run the sample, and you will get the expected results.

I believe this is breaking change is due to the removal of Newtonsoft.Json.

Thanks

ngocnicholas commented 1 year ago

Hi Tiago, Regarding the case-sensitivity issue, you're right that 1.2.0 likely introduced case-sensitive matching, which is a breaking change. I didn't realize this change in behavior at the time or else I would have at least messaged the breaking change. Sorry for the inconvenience. To work around it, you can try using the [JsonPropertyName("username")] attribute.

I'm having trouble reproducing the date-parsing issue. Can you please clarify your Airtable schema? Is FooDate a date or text field? It'd be most helpful if you could provide a screenshot of your Airtable field configuration (with the "Edit field" dialog open).

TiagoBrenck commented 1 year ago

Thanks for the suggestion @ngocnicholas . I will give it a try with JsonPropertyName attribute then.

About the Airtable scheme, I will need more time to get it for you. I am just responsible for a C# ETL that picks records from an Airtable view, which I don't have access to its source. I would guess that the field is text type though.

ngocnicholas commented 1 year ago

No more info from user since 2 weeks ago.