1 # This file is generated by nitrestful
2 # Do not modify, instead refine the generated services.
3 module restful_annot_rest is
4 no_warning("parentheses")
10 redef fun answer(request, truncated_uri)
12 var resources = truncated_uri.split("/")
13 if resources.not_empty and resources.first.is_empty then resources.shift
15 if resources.length != 1 then return super
16 var resource = resources.first
18 if (resource == "foo") then
19 var in_s = request.string_arg("s")
22 var in_i = request.string_arg("i")
23 var out_i = deserialize_arg(in_i)
25 var in_b = request.string_arg("b")
26 var out_b = deserialize_arg(in_b)
28 if not out_s isa String or not out_i isa Int or not out_b isa Bool then
31 return foo(out_s, out_i, out_b)
32 else if (resource == "api_name" or resource == "alt_name") and (request.method == "GET" or request.method == "PUT") then
33 var in_s = request.string_arg("s")
36 var in_i = request.string_arg("i")
37 var out_i = deserialize_arg(in_i)
39 var in_b = request.string_arg("b")
40 var out_b = deserialize_arg(in_b)
42 if not out_i isa nullable Int or not out_b isa nullable Bool then
45 return bar(out_s, out_i, out_b)