Skip to content

Commit

Permalink
#3 chore: add info about data format
Browse files Browse the repository at this point in the history
  • Loading branch information
batopa committed Nov 14, 2016
1 parent cc699b9 commit 0ec9205
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/formatting_bedita_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ add to the formatted object the count of relations and children.
By default no count is done.


.. _formatting-objects-cast-types:

Help ``ApiFormatter`` to cast object fields in the right way
------------------------------------------------------------

Expand Down
19 changes: 19 additions & 0 deletions source/response_and_erroros.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ where:
Content** HTTP status code. Pass another status code as first argument to send
different status code.

``data`` fields format
~~~~~~~~~~~~~~~~~~~~~~

Every response in data is formatted in the right type usually according to database fields type.
So it can contain values as integers, floats, booleans and dates.

While other types are clear we need to clarify the format used for dates.
All reponse dates are formatted using `ISO-8601 <https://en.wikipedia.org/wiki/ISO_8601>`_ standard combining
date and time, for example ``2016-11-14T15:54:01+01:00``.

The client should always send dates in that format or using the form with **Z** as zone designator to indicate UTC,
coming for example from javascript function ``Date().toISOString()``.

So the same date should be sent from client as ``2016-11-14T15:54:01+01:00`` or ``2016-11-14T14:54:01.640Z``.

.. tip::

If you need to customize the format data types you could be interesed in reading :ref:`formatting-objects-cast-types`

Errors
------

Expand Down

0 comments on commit 0ec9205

Please sign in to comment.