op.setConsumes(ImmutableList.of(MediaType.multipart.name())); } else if (it.kind() == RouteParameter.Kind.FORM) { op.setConsumes(ImmutableList.of(MediaType.form.name(), MediaType.multipart.name()));
protected void processConsumes(String[] consumes, Operation operation) { if (null == consumes || consumes.length == 0) { return; } List<String> consumeList = Arrays.stream(consumes).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operation.setConsumes(consumeList); } }
private void convertConsumes(String consumes, Operation operation) { if (StringUtils.isEmpty(consumes)) { return; } List<String> consumeList = Arrays.stream(consumes.split(SEPARATOR)).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operation.setConsumes(consumeList); } }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { Consumes consumes = (Consumes) annotation; List<String> consumeList = Arrays.stream(consumes.value()).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operationGenerator.getOperation().setConsumes(consumeList); } } }
public Operation consumes(List<String> consumes) { this.setConsumes(consumes); return this; }
protected void processConsumes(String[] consumes, Operation operation) { if (null == consumes || consumes.length == 0) { return; } operation.setConsumes(Arrays.asList(consumes)); }
protected void processConsumes(String[] consumes, Operation operation) { if (null == consumes || consumes.length == 0) { return; } List<String> consumeList = Arrays.stream(consumes).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operation.setConsumes(consumeList); } }
private void convertConsumes(String consumes, Operation operation) { if (StringUtils.isEmpty(consumes)) { return; } List<String> consumeList = Arrays.stream(consumes.split(SEPARATOR)).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operation.setConsumes(consumeList); } }
@Override public void process(Object annotation, OperationGenerator operationGenerator) { Consumes consumes = (Consumes) annotation; List<String> consumeList = Arrays.stream(consumes.value()).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!consumeList.isEmpty()) { operationGenerator.getOperation().setConsumes(consumeList); } } }
@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.setConsumes(accepts.isEmpty() ? produces : accepts); operation.setProduces(produces); operation.setDeprecated(method.isAnnotationPresent(Deprecated.class)
operation.setConsumes(accepts.isEmpty() ? produces : accepts); operation.setProduces(produces); operation.setDeprecated(method.isAnnotationPresent(Deprecated.class)
Operation operation = operations.get(method); if (isEmpty(operation.getConsumes())) operation.setConsumes(swagger.getConsumes()); if (isEmpty(operation.getProduces())) operation.setProduces(swagger.getProduces());
operation.getOperation().setConsumes(consumes);
operation.setConsumes(consumes);
op.setConsumes(ImmutableList.of(MediaType.multipart.name())); } else if (it.kind() == RouteParameter.Kind.FORM) { op.setConsumes(ImmutableList.of(MediaType.form.name(), MediaType.multipart.name()));
List<String> consumesList = new ArrayList<>(); consumesList.add(uriTemplate.getContentType()); operation.setConsumes(consumesList);
List<String> consumesList = new ArrayList<>(); consumesList.add(uriTemplate.getContentType()); operation.setConsumes(consumesList);
operation.setConsumes(Arrays.asList(HttpConstants.ContentType.MULTIPART_FORM_DATA)); } else if (!operation.getConsumes().contains(HttpConstants.ContentType.MULTIPART_FORM_DATA)) { operation.setConsumes(Arrays.asList(HttpConstants.ContentType.APPLICATION_FORM_URLENCODED));