We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Question: Why doesn't API support date type like JSON type does?

Answered
Bill Kaper asked on January 9, 2024

Hi,

We recently switched from sending the data to the client via a JSON file to a custom implementation of FDS using the .NET DLL built as its own web server. We were surprised to see strings that were previously typed as "date" to now being typed as "date string" even though our mapping was explicitly set to "date".

After further research in the docs, we found this ticket: https://www.flexmonster.com/question/how-to-use-date-data-type-api-data-source/?hilite=%22date%22%2C%22string%22 that stated that date isn't supported by the API - only "date string". 

My question is why is that the case? Wouldn't the API be sending a JSON string back to the client from the API and wouldn't the client be able to handle that just like it does from a JSON file data source? I think this would far more helpful than having a bifurcation in what date types are supported by different data sources when the underlying piece of information in the client side javascript should be the same thing. 

Is there any way date support could be added for api/fds data sources as well as the JSON data source?

Thanks,
Bill

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster January 11, 2024

Hello Bill,

Thank you for the questions. 

We understand your concerns, and the suggestion of adding the "date" field type for "api" data sources sounds reasonable. We want to explain that we thoroughly chose the field type to be supported for such data sources. The "date string" type was chosen as a compromise between flexibility and simplicity. We are aware of the request to add the "date" field type, and this feature has already been added to our backlog. There's no clear ETA at the moment, but our team will notify you if there are any updates on the matter.

You are welcome to contact us if any questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer