You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
API should send and accept null for undefined values #2696
See #2657 for the decision on null handling: null should be sent by the API whenever a value is unknown or not yet set.
A prime example of this is post_date_gmt, as described in #2303, which will be 0000-00-00 00:00:00 (an invalid date) for posts newly created via WP-Admin or via this API: if this value is sent to a client literally the API is providing an invalid value. null should be sent instead.
Correspondingly, null should be accepted by the API for post_date_gmt (and other fields that display this issue), so that a client can always turn the response for a resource around and send it back without further transformation: returning the API's output JSON as unchanged input should never trigger an error.
See #2657 for the decision on
nullhandling:nullshould be sent by the API whenever a value is unknown or not yet set.A prime example of this is
post_date_gmt, as described in #2303, which will be0000-00-00 00:00:00(an invalid date) for posts newly created via WP-Admin or via this API: if this value is sent to a client literally the API is providing an invalid value.nullshould be sent instead.Correspondingly,
nullshould be accepted by the API forpost_date_gmt(and other fields that display this issue), so that a client can always turn the response for a resource around and send it back without further transformation: returning the API's output JSON as unchanged input should never trigger an error.