protected void processProduces(String[] produces, Swagger swagger) { if (null == produces || produces.length == 0) { return; } swagger.setProduces(Arrays.asList(produces)); } }
private void correctProduces() { List<String> produces = swagger.getProduces(); if (produces == null || produces.isEmpty()) { produces = Arrays.asList(MediaType.APPLICATION_JSON); swagger.setProduces(produces); } }
private void convertProduces(SwaggerDefinition definitionAnnotation, Swagger swagger) { String[] produces = definitionAnnotation.produces(); if (produces == null) { return; } List<String> produceList = Arrays.stream(produces).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { swagger.setProduces(produceList); } }
private void processProduces(Api api, Swagger swagger) { List<String> validProducesList = getValidStringList(api.produces()); if (isBlank(swagger.getProduces()) && !validProducesList.isEmpty()) { swagger.setProduces(validProducesList); } }
public Swagger produces(List<String> produces) { this.setProduces(produces); return this; }
protected void processProduces(String[] produces, Swagger swagger) { if (null == produces || produces.length == 0) { return; } swagger.setProduces(Arrays.asList(produces)); } }
protected void processProduces(String[] produces, Swagger swagger) { if (null == produces || produces.length == 0) { return; } swagger.setProduces(Arrays.asList(produces)); } }
private void correctProduces() { List<String> produces = swagger.getProduces(); if (produces == null || produces.isEmpty()) { produces = Arrays.asList(MediaType.APPLICATION_JSON); swagger.setProduces(produces); } }
private void convertProduces(SwaggerDefinition definitionAnnotation, Swagger swagger) { String[] produces = definitionAnnotation.produces(); if (produces == null) { return; } List<String> produceList = Arrays.stream(produces).filter(s -> !StringUtils.isEmpty(s)) .collect(Collectors.toList()); if (!produceList.isEmpty()) { swagger.setProduces(produceList); } }
private void processProduces(Api api, Swagger swagger) { List<String> validProducesList = getValidStringList(api.produces()); if (isBlank(swagger.getProduces()) && !validProducesList.isEmpty()) { swagger.setProduces(validProducesList); } }
private void prepareSwagger() { List<String> json = Collections.singletonList(Operation.MEDIA_TYPE_APPLICATION_JSON); this.swagger.setConsumes(json); this.swagger.setProduces(json); if (this.service.getHost().getSecureListener() != null) { this.swagger.setSchemes(Collections.singletonList(Scheme.HTTPS)); URI uri = this.service.getHost().getSecureUri(); this.swagger.setHost(uri.getHost() + ":" + uri.getPort()); } else { this.swagger.setSchemes(Collections.singletonList(Scheme.HTTP)); URI uri = this.service.getHost().getPublicUri(); this.swagger.setHost(uri.getHost() + ":" + uri.getPort()); } this.swagger.setSchemes(new ArrayList<>()); this.swagger.setInfo(this.info); this.swagger.setBasePath(UriUtils.URI_PATH_CHAR); }
combined.setProduces(Lists.newArrayList(produces));
private Swagger createSwagger(final Set<Class<?>> classes,final URL url){ Swagger swagger = new Reader(new Swagger()).read(classes); Info info = getSwaggerInfo(swagger); if(info!=null)swagger.setInfo(info); Map<String, SecuritySchemeDefinition> securityDefinitions = getSecurityDefinitions(swagger); if(securityDefinitions!=null)swagger.setSecurityDefinitions(securityDefinitions); String consumes = whiteLabel.getProperty(CONSUMES, null); if(anyIsSet(consumes))swagger.setConsumes(toList(swagger.getConsumes(),consumes)); String produces = whiteLabel.getProperty(PRODUCES, null); if(anyIsSet(produces))swagger.setProduces(toList(swagger.getProduces(),produces)); String basePath = whiteLabel.getProperty(BASE_PATH, getBasePath(swagger.getBasePath(), url)); if(anyIsSet(basePath))swagger.setBasePath(basePath); String schemes = whiteLabel.getProperty(SCHEMES, url.getProtocol().toUpperCase()); if(anyIsSet(schemes))swagger.setSchemes(toSchemeList(swagger.getSchemes(),schemes)); String host = whiteLabel.getProperty(HOST, url.getHost() + DOUBLE_POINT + url.getPort()); if(anyIsSet(host))swagger.setHost(host); String tags = whiteLabel.getProperty(TAGS, null); if(anyIsSet(tags))swagger.setTags(toTagList(swagger.getTags(),tags)); return swagger; }
@Override public void swagger(Swagger swagger) { swagger.setSchemes(fillList(swagger.getSchemes())); swagger.setConsumes(fillList(swagger.getConsumes())); swagger.setProduces(fillList(swagger.getProduces())); swagger.setPaths(fillMap(swagger.getPaths())); swagger.setDefinitions(fillMap(swagger.getDefinitions())); swagger.setParameters(fillMap(swagger.getParameters())); swagger.setResponses(fillMap(swagger.getResponses())); swagger.setSecurityDefinitions(fillMap(swagger.getSecurityDefinitions())); swagger.setSecurity(fillList(swagger.getSecurity())); swagger.setTags(fillList(swagger.getTags())); }