use of io.servicecomb.swagger.generator.core.processor.annotation.models.ResponseHeaderConfig in project java-chassis by ServiceComb.
the class AnnotationUtils method convert.
public static ResponseHeaderConfig convert(ResponseHeader responseHeader) {
if (StringUtils.isEmpty(responseHeader.name())) {
return null;
}
ResponseHeaderConfig config = new ResponseHeaderConfig();
config.setName(responseHeader.name());
config.setDescription(responseHeader.description());
config.setResponseClass(responseHeader.response());
config.setResponseContainer(responseHeader.responseContainer());
return config;
}
use of io.servicecomb.swagger.generator.core.processor.annotation.models.ResponseHeaderConfig in project java-chassis by ServiceComb.
the class ResponseHeaderProcessor method process.
@Override
public void process(Object annotation, OperationGenerator operationGenerator) {
ResponseHeader responseHeader = (ResponseHeader) annotation;
ResponseHeaderConfig config = AnnotationUtils.convert(responseHeader);
if (config != null) {
Property property = AnnotationUtils.generateResponseHeaderProperty(operationGenerator.getSwagger(), config);
operationGenerator.addResponseHeader(config.getName(), property);
}
}
use of io.servicecomb.swagger.generator.core.processor.annotation.models.ResponseHeaderConfig in project java-chassis by ServiceComb.
the class AnnotationUtils method generateResponseHeader.
private static Map<String, Property> generateResponseHeader(Swagger swagger, List<ResponseHeaderConfig> responseHeaders) {
Map<String, Property> headers = new HashMap<>();
for (ResponseHeaderConfig config : responseHeaders) {
Property property = generateResponseHeaderProperty(swagger, config);
headers.put(config.getName(), property);
}
return headers;
}
Aggregations