Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
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

@kadamwhite

Description

@kadamwhite

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.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions