protected void processProduces(String[] produces, Operation operation) { if (null == produces || produces.length == 0) { return; } List<String> produceList = Arrays.stream(produces).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operation.setProduces(produceList); } } }
private void convertProduces(String produces, Operation operation) { if (StringUtils.isEmpty(produces)) { return; } List<String> produceList = Arrays.stream(produces.split(SEPARATOR)).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operation.setProduces(produceList); } }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { Produces produces = (Produces) annotation; List<String> produceList = Arrays.stream(produces.value()).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operationGenerator.getOperation().setProduces(produceList); } } }
public Operation produces(List<String> produces) { this.setProduces(produces); return this; }
protected void processProduces(String[] produces, Operation operation) { if (null == produces || produces.length == 0) { return; } operation.setProduces(Arrays.asList(produces)); } }
protected void processProduces(String[] produces, Operation operation) { if (null == produces || produces.length == 0) { return; } List<String> produceList = Arrays.stream(produces).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operation.setProduces(produceList); } } }
private void convertProduces(String produces, Operation operation) { if (StringUtils.isEmpty(produces)) { return; } List<String> produceList = Arrays.stream(produces.split(SEPARATOR)).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operation.setProduces(produceList); } }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { Produces produces = (Produces) annotation; List<String> produceList = Arrays.stream(produces.value()).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { operationGenerator.getOperation().setProduces(produceList); } } }
@Override public void operation(HttpMethod httpMethod, Operation operation) { if (operation.getConsumes() == null) { operation.setConsumes(model.getConsumes()); } if (operation.getProduces() == null) { operation.setProduces(model.getProduces()); } } });
private Map<String, Path> getPaths() { Map<String, Path> paths = new HashMap<>(); Path path = new Path(); Operation post = new Operation(); post.setOperationId("configure"); post.setConsumes(Arrays.asList("application/json", "application/xml")); post.setProduces(Arrays.asList("application/json", "application/xml")); List<Parameter> parameters = new ArrayList<>(); Parameter in = new BodyParameter().schema(new RefModel("#/definitions/inputs")); in.setRequired(true); in.setName(INPUTS); parameters.add(in); post.setParameters(parameters); Map<String, Response> responses = new HashMap<>(); Response response = new Response().description("Success"); responses.put("200", response); Response failureResponse = new Response().description("Failure"); responses.put("400", failureResponse); post.setResponses(responses); path.setPost(post); paths.put("/operations/config-selfservice-api:configure", path); return paths; }
operation.setProduces(produces); operation.setDeprecated(method.isAnnotationPresent(Deprecated.class) || controller.isAnnotationPresent(Deprecated.class));
operation.setProduces(produces); operation.setDeprecated(method.isAnnotationPresent(Deprecated.class) || controller.isAnnotationPresent(Deprecated.class));
operation.setConsumes(swagger.getConsumes()); if (isEmpty(operation.getProduces())) operation.setProduces(swagger.getProduces());
operation.getOperation().setProduces(produces);
operation.setProduces(produces);