Adding a field to a core REST response means either filtering the prepared object, which is fragile, or registering the field properly so it appears in the schema as well as the payload.
register_rest_field( 'post', 'reading_time', array(
'get_callback' => function ( $post ) {
return shop_reading_time( $post['id'] );
},
'schema' => array(
'description' => 'Estimated reading time in minutes.',
'type' => 'integer',
'context' => array( 'view' ),
),
) );
The schema entry is what makes the field discoverable by a client reading OPTIONS, and it is optional in the sense that omitting it works and leaves the API undocumented. An update_callback makes the field writable, and without one the field is silently ignored on a write rather than rejected — which reads as a bug from the client side.