com.github.kongchen.swagger.docgen.reader.ResponseContainerConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagger-maven-plugin
Show all versions of swagger-maven-plugin
A maven build plugin which helps you generate API document during build phase
package com.github.kongchen.swagger.docgen.reader;
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.MapProperty;
import io.swagger.models.properties.Property;
/**
* Property wrapper for response container.
*/
class ResponseContainerConverter {
Property withResponseContainer(String responseContainer, Property property) {
if ("list".equalsIgnoreCase(responseContainer)) {
return new ArrayProperty(property);
}
if ("set".equalsIgnoreCase(responseContainer)) {
return new ArrayProperty(property).uniqueItems();
}
if ("map".equalsIgnoreCase(responseContainer)) {
return new MapProperty(property);
}
return property;
}
}