use of io.swagger.models.Info in project syndesis by syndesisio.
the class BaseSwaggerConnectorGenerator method determineConnectorName.
@Override
protected final String determineConnectorName(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) {
final SwaggerModelInfo modelInfo = parseSpecification(connectorSettings, false);
if (!modelInfo.getErrors().isEmpty()) {
throw new IllegalArgumentException("Given Swagger specification contains errors: " + modelInfo);
}
final Swagger swagger = modelInfo.getModel();
final Info info = swagger.getInfo();
if (info == null) {
return super.determineConnectorName(connectorTemplate, connectorSettings);
}
final String title = info.getTitle();
if (title == null) {
return super.determineConnectorName(connectorTemplate, connectorSettings);
}
return title;
}
use of io.swagger.models.Info in project java-chassis by ServiceComb.
the class SwaggerUtils method getInterface.
public static Class<?> getInterface(Swagger swagger) {
Info info = swagger.getInfo();
if (info == null) {
return null;
}
String name = getInterfaceName(info.getVendorExtensions());
if (StringUtils.isEmpty(name)) {
return null;
}
return ReflectUtils.getClassByName(name);
}
use of io.swagger.models.Info in project java-chassis by ServiceComb.
the class AbstractSwaggerGenerator method correctInfo.
private void correctInfo() {
Info info = swagger.getInfo();
if (info == null) {
info = new Info();
swagger.setInfo(info);
}
if (StringUtils.isEmpty(info.getTitle())) {
info.setTitle("swagger definition for " + cls.getName());
}
if (StringUtils.isEmpty(info.getVersion())) {
info.setVersion("1.0.0");
}
setJavaInterface(info);
}
use of io.swagger.models.Info in project nutzboot by nutzam.
the class SwaggerServletStarter method init.
public void init(ServletConfig config) throws ServletException {
PropertiesProxy conf = appContext.getConfigureLoader().get();
swagger = conf.makeDeep(Swagger.class, "swagger.conf.");
Info info = conf.makeDeep(Info.class, "swagger.info.");
swagger.setInfo(info);
HashSet<Class<?>> classes = new HashSet<>();
String pkgName = conf.get("swagger.resource.package", appContext.getPackage());
for (Class<?> klass : Scans.me().scanPackage(pkgName)) {
classes.add(klass);
}
Reader.read(swagger, classes);
}
Aggregations