lib/noise: move ImprovedNoise from the rosetta perlin noise example
[nit.git] / tests / sav / nitrestful_args1.res
1 # This file is generated by nitrestful
2 # Do not modify, instead refine the generated services.
3 module restful_annot_rest
4
5 import restful_annot
6
7 redef class MyAction
8         redef fun answer(request, truncated_uri)
9         do
10                 var verbs = truncated_uri.split("/")
11                 if verbs.not_empty and verbs.first.is_empty then verbs.shift
12
13                 if verbs.length != 1 then return super
14                 var verb = verbs.first
15
16                 if verb == "foo" then
17                         var in_s = request.string_arg("s")
18                         var out_s = in_s
19
20                         var in_i = request.string_arg("i")
21                         var out_i = deserialize_arg(in_i)
22
23                         var in_b = request.string_arg("b")
24                         var out_b = deserialize_arg(in_b)
25
26                         if not out_s isa String or not out_i isa Int or not out_b isa Bool then
27                                 return super
28                         end
29                         return foo(out_s, out_i, out_b)
30                 else if verb == "bar" then
31                         var in_s = request.string_arg("s")
32                         var out_s = in_s
33
34                         var in_i = request.string_arg("i")
35                         var out_i = deserialize_arg(in_i)
36
37                         var in_b = request.string_arg("b")
38                         var out_b = deserialize_arg(in_b)
39
40                         if not out_i isa nullable Int or not out_b isa nullable Bool then
41                                 return super
42                         end
43                         return bar(out_s, out_i, out_b)
44                 end
45                 return super
46         end
47 end