From 7ca78372d894b838a5674c8165ebbb26da9803b8 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 5 May 2017 15:23:28 -0400 Subject: [PATCH] popcorn/pop_handlers: HttpResponse::json_* accepts any Serializable Signed-off-by: Jean Privat --- lib/popcorn/pop_handlers.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/popcorn/pop_handlers.nit b/lib/popcorn/pop_handlers.nit index f55126f..8824db0 100644 --- a/lib/popcorn/pop_handlers.nit +++ b/lib/popcorn/pop_handlers.nit @@ -451,7 +451,7 @@ redef class HttpResponse end # Write data as JSON and set the right content type header. - fun json(json: nullable Jsonable, status: nullable Int) do + fun json(json: nullable Serializable, status: nullable Int) do header["Content-Type"] = media_types["json"].as(not null) if json == null then send(null, status) @@ -471,7 +471,7 @@ redef class HttpResponse end # Write error as JSON and set the right content type header. - fun json_error(error: nullable Jsonable, status: nullable Int) do + fun json_error(error: nullable Serializable, status: nullable Int) do json(error, status) end -- 1.7.9.5