| // Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| // license agreements; and to You under the Apache License, Version 2.0. |
| |
| /* |
| * This action validates the parameters passed to the hello world action and |
| * returns an error if any of them is missing. |
| */ |
| function main(params) { |
| if(params.name && params.place) { |
| return params; |
| } else { |
| return { |
| error: { |
| body: { |
| message: 'Attributes name and place are mandatory' |
| }, |
| statusCode: 400, |
| headers: {'Content-Type': 'application/json'} |
| } |
| } |
| } |
| } |