private void setDefaultTag() { // if tag has been defined, do nothing if (null != operation.getTags()) { for (String tag : operation.getTags()) { if (!StringUtils.isEmpty(tag)) { return; } } } // if there is no tag, set default tag if (!swaggerGenerator.getDefaultTags().isEmpty()) { operation.setTags(new ArrayList<>(swaggerGenerator.getDefaultTags())); } }
public Operation tags(List<String> tags) { this.setTags(tags); return this; }
private void moveOperationsToSingleClient(Swagger swagger) { swagger.getPaths().values().forEach(path -> path.getOperations().forEach(operation -> operation.setTags(Collections.singletonList("client")) ) ); }
/** * Creates tag model for swagger operation. * * @param annotationExpression The annotation expression value which has tags. * @param operation The swagger operation. */ private void createTagModel(BLangExpression annotationExpression, Operation operation) { if (null != annotationExpression) { List<? extends ExpressionNode> tagExprs = ((BLangArrayLiteral) annotationExpression).getExpressions(); List<String> tags = new LinkedList<>(); for (ExpressionNode expr : tagExprs) { if (expr instanceof BLangLiteral) { BLangLiteral tagLit = (BLangLiteral) expr; tags.add(ConverterUtils.getStringLiteralValue(tagLit)); } } operation.setTags(tags); } }
private void setDefaultTag() { // if tag has been defined, do nothing if (null != operation.getTags()) { for (String tag : operation.getTags()) { if (!StringUtils.isEmpty(tag)) { return; } } } // if there is no tag, set default tag if (!swaggerGenerator.getDefaultTags().isEmpty()) { operation.setTags(new ArrayList<>(swaggerGenerator.getDefaultTags())); } }
@Override public void operation(HttpMethod httpMethod, Operation operation) { operation.setTags(fillList(operation.getTags())); operation.setParameters(fillList(operation.getParameters())); operation.setResponses(fillMap(operation.getResponses())); operation.setSchemes(fillList(operation.getSchemes())); }
subentry.getValue().setTags(Collections.singletonList(tag.getName()));