api2/node/time.rs: add return schema

This commit is contained in:
Dietmar Maurer 2019-01-24 11:07:11 +01:00
parent 447787ab7c
commit cd8b91f78c

View File

@ -31,9 +31,19 @@ fn get_time(_param: Value, _info: &ApiMethod) -> Result<Value, Error> {
pub fn router() -> Router { pub fn router() -> Router {
let route = Router::new() let route = Router::new()
.get(ApiMethod::new( .get(
get_time, ApiMethod::new(
ObjectSchema::new("Read server time and time zone settings."))); 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 route
} }