-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Expand file tree
/
Copy pathAnotherFakeApiController.java
More file actions
59 lines (50 loc) · 1.86 KB
/
AnotherFakeApiController.java
File metadata and controls
59 lines (50 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package controllers;
import apimodels.Client;
import com.typesafe.config.Config;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Http;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
import openapitools.OpenAPIUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import javax.validation.constraints.*;
import com.typesafe.config.Config;
import openapitools.OpenAPIUtils.ApiAction;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen")
public class AnotherFakeApiController extends Controller {
private final AnotherFakeApiControllerImpInterface imp;
private final ObjectMapper mapper;
private final Config configuration;
@Inject
private AnotherFakeApiController(Config configuration, AnotherFakeApiControllerImpInterface imp) {
this.imp = imp;
mapper = new ObjectMapper();
this.configuration = configuration;
}
@ApiAction
public Result call123testSpecialTags() throws Exception {
JsonNode nodebody = request().body().asJson();
Client body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Client.class);
if (configuration.getBoolean("useInputBeanValidation")) {
OpenAPIUtils.validate(body);
}
} else {
throw new IllegalArgumentException("'body' parameter is required");
}
Client obj = imp.call123testSpecialTags(body);
if (configuration.getBoolean("useOutputBeanValidation")) {
OpenAPIUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
}