From cd8b91f78ce9d7d47c2d4fec714466ef1501220a Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 24 Jan 2019 11:07:11 +0100 Subject: [PATCH] api2/node/time.rs: add return schema --- src/api2/node/time.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/api2/node/time.rs b/src/api2/node/time.rs index 7a31fbd2..aab051b1 100644 --- a/src/api2/node/time.rs +++ b/src/api2/node/time.rs @@ -31,9 +31,19 @@ fn get_time(_param: Value, _info: &ApiMethod) -> Result { pub fn router() -> Router { let route = Router::new() - .get(ApiMethod::new( - get_time, - ObjectSchema::new("Read server time and time zone settings."))); + .get( + ApiMethod::new( + get_time, ObjectSchema::new("Read server time and time zone settings.")) + .returns( + ObjectSchema::new("Returns server time and timezone.") + .required("timezone", StringSchema::new("Time zone")) + .required("time", IntegerSchema::new("Seconds since 1970-01-01 00:00:00 UTC.") + .minimum(1297163644)) + .required("localtime", IntegerSchema::new("Seconds since 1970-01-01 00:00:00 UTC. (local time)") + .minimum(1297163644)) + ) + ); + route }