responseProperty = property; responseProperty.setDescription(header.description()); responseHeaders.put(header.name(), responseProperty);
public Property convertProperty(ModelProperty property) { Property output = null; output = propertyFromTypedObject(property); output.setDescription(property.getDescription()); return output; }
/** * Creates headers definitions for swagger response. * * @param annotationExpression The annotation attribute value which has the headers. * @param response The swagger response. */ private void createHeadersModel(BLangExpression annotationExpression, Response response) { if (null != annotationExpression) { BLangArrayLiteral headerArray = (BLangArrayLiteral) annotationExpression; for (ExpressionNode headersValue : headerArray.getExpressions()) { List<BLangRecordKeyValue> headerList = ((BLangRecordLiteral) headersValue).getKeyValuePairs(); Map<String, BLangExpression> headersAttributes = ConverterUtils.listToMap(headerList); Map<String, Property> headers = new HashMap<>(); if (headersAttributes.containsKey(ConverterConstants.ATTR_NAME) && headersAttributes .containsKey(ConverterConstants.ATTR_HEADER_TYPE)) { String headerName = ConverterUtils .getStringLiteralValue(headersAttributes.get(ConverterConstants.ATTR_NAME)); String type = ConverterUtils .getStringLiteralValue(headersAttributes.get(ConverterConstants.ATTR_HEADER_TYPE)); Property property = getSwaggerProperty(type); if (headersAttributes.containsKey(ConverterConstants.ATTR_DESCRIPTION)) { property.setDescription(ConverterUtils .getStringLiteralValue(headersAttributes.get(ConverterConstants.ATTR_DESCRIPTION))); } headers.put(headerName, property); } response.setHeaders(headers); } } }
responseProperty = property; responseProperty.setDescription(description); responseHeaders.put(name, responseProperty);
property.setDescription(xsdParser.getAnnotation(model.getName(), field.getName()));
private static Map<String, Property> parseResponseHeaders(Swagger swagger, ReaderContext context, ResponseHeader[] headers) { Map<String, Property> responseHeaders = null; for (ResponseHeader header : headers) { final String name = header.name(); if (StringUtils.isNotEmpty(name)) { if (responseHeaders == null) { responseHeaders = new HashMap<String, Property>(); } final Class<?> cls = header.response(); if (!ReflectionUtils.isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls); if (property != null) { final Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(header.description()); responseHeaders.put(name, responseProperty); appendModels(swagger, cls); } } } } return responseHeaders; }
private Map<String, Property> parseResponseHeaders(ResponseHeader[] headers, JsonView jsonView) { Map<String, Property> responseHeaders = null; if (headers != null) { for (ResponseHeader header : headers) { String name = header.name(); if (!"".equals(name)) { if (responseHeaders == null) { responseHeaders = new LinkedHashMap<String, Property>(); } String description = header.description(); Class<?> cls = header.response(); if (!isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls, jsonView); if (property != null) { Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(description); responseHeaders.put(name, responseProperty); appendModels(cls); } } } } } return responseHeaders; }
private Map<String, Property> parseResponseHeaders(ResponseHeader[] headers) { Map<String, Property> responseHeaders = null; if (headers != null && headers.length > 0) { for (ResponseHeader header : headers) { String name = header.name(); if (!"".equals(name)) { if (responseHeaders == null) { responseHeaders = new HashMap<>(); } String description = header.description(); Class<?> cls = header.response(); if (!isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls); if (property != null) { Property responseProperty = ContainerWrapper .wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(description); responseHeaders.put(name, responseProperty); appendModels(cls); } } } } } return responseHeaders; }
private Map<String, Property> parseResponseHeaders(ResponseHeader[] headers) { Map<String, Property> responseHeaders = null; if (headers != null) { for (ResponseHeader header : headers) { String name = header.name(); if (!"".equals(name)) { if (responseHeaders == null) { responseHeaders = new LinkedHashMap<>(); } String description = header.description(); Class<?> cls = header.response(); if (!isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls); if (property != null) { Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(description); responseHeaders.put(name, responseProperty); appendModels(cls); } } } } } return responseHeaders; }
private Map<String, Property> parseResponseHeaders(ResponseHeader[] headers) { Map<String, Property> responseHeaders = null; if (headers != null && headers.length > 0) { for (ResponseHeader header : headers) { String name = header.name(); if (!"".equals(name)) { if (responseHeaders == null) { responseHeaders = new HashMap<>(); } String description = header.description(); Class<?> cls = header.response(); if (!isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls); if (property != null) { Property responseProperty = ContainerWrapper .wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(description); responseHeaders.put(name, responseProperty); appendModels(cls); } } } } } return responseHeaders; }
private Map<String, Property> parseResponseHeaders(ResponseHeader[] headers, JsonView jsonView) { Map<String, Property> responseHeaders = null; if (headers != null) { for (ResponseHeader header : headers) { String name = header.name(); if (!"".equals(name)) { if (responseHeaders == null) { responseHeaders = new LinkedHashMap<String, Property>(); } String description = header.description(); Class<?> cls = header.response(); if (!isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls, jsonView); if (property != null) { Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(description); responseHeaders.put(name, responseProperty); appendModels(cls); } } } } } return responseHeaders; }
private static Map<String, Property> parseResponseHeaders(ReaderContext context, ResponseHeader[] headers) { Map<String, Property> responseHeaders = null; for (ResponseHeader header : headers) { final String name = header.name(); if (StringUtils.isNotEmpty(name)) { if (responseHeaders == null) { responseHeaders = new HashMap<String, Property>(); } final Class<?> cls = header.response(); if (!ReflectionUtils.isVoid(cls)) { final Property property = ModelConverters.getInstance().readAsProperty(cls); if (property != null) { final Property responseProperty = ContainerWrapper.wrapContainer( header.responseContainer(), property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); responseProperty.setDescription(header.description()); responseHeaders.put(name, responseProperty); appendModels(context.getSwagger(), cls); } } } } return responseHeaders; }
property.setAccess(ann.access()); property.setDefault(ann.defaultValue()); property.setDescription(ann.description()); model.addProperty(ann.value(), property); });
property.setDescription(translate(apiProperty.descriptionKey(), apiProperty.description()));
property.setDescription(translate(apiProperty.descriptionKey(), apiProperty.description()));
defProperty.setDescription(propertyDefinition.getDescription()); return defProperty;
property.setDescription(headerTag.getDescription()); response.addHeader(property.getName(), property);
property.setDescription(headerTag.getDescription()); response.addHeader(property.getName(), property);
} else { final Property prop_1 = this.createSwaggerPropertyWithConstraints(it); prop_1.setDescription(this._zenModelHelper.getDocumentation(it)); swaggerResponse.getHeaders().put(it.getName(), prop_1);
attribute.setDescription(getFieldPermissions(clazz, attributeName)); entitySchema.addAttribute(attributeName, attribute);