atk4 / api

Implementation of RestAPI for Agile Data
https://agiletoolkit.org/
14 stars 12 forks source link

Fix data#403: return date, time and datetime as scalar value #18

Open PhilippGrashoff opened 5 years ago

PhilippGrashoff commented 5 years ago

This is supposed as proposal to fix https://github.com/atk4/data/issues/403 going with the solution @DarkSide666 proposed.

PhilippGrashoff commented 5 years ago

Hi, that was not the code I intended to PR. Will update with better solution.

PhilippGrashoff commented 5 years ago

Now this is a sensible first proposal.

I wonder about two things: 1) how are fields like money treated on export with 3d parameter set to false.. I think casting here makes sense (2 digits after the dot). 2) fields that have some serialisation set. Wouldn't it be sensible to also send them JSON serialized over API as its the standard. I am thinking of a field that is stored serialized using PHPs serialize. un_serialize and json_encode would be the desired way for the API, wouldnt it?