本文整理了Java中io.swagger.models.Swagger.setExternalDocs()
方法的一些代码示例,展示了Swagger.setExternalDocs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.setExternalDocs()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:setExternalDocs
暂无
代码示例来源:origin: kongchen/swagger-maven-plugin
public AbstractDocumentSource(Log log, ApiSource apiSource) throws MojoFailureException {
LOG = log;
this.outputPath = apiSource.getOutputPath();
this.templatePath = apiSource.getTemplatePath();
this.swaggerPath = apiSource.getSwaggerDirectory();
this.modelSubstitute = apiSource.getModelSubstitute();
this.jsonExampleValues = apiSource.isJsonExampleValues();
swagger = new Swagger();
if (apiSource.getSchemes() != null) {
for (String scheme : apiSource.getSchemes()) {
swagger.scheme(Scheme.forValue(scheme));
}
}
// read description from file
if (apiSource.getDescriptionFile() != null) {
try {
InputStream is = new FileInputStream(apiSource.getDescriptionFile());
apiSource.getInfo().setDescription(IOUtils.toString(is));
is.close();
} catch (IOException e) {
throw new MojoFailureException(e.getMessage(), e);
}
}
swagger.setHost(apiSource.getHost());
swagger.setInfo(apiSource.getInfo());
swagger.setBasePath(apiSource.getBasePath());
swagger.setExternalDocs(apiSource.getExternalDocs());
this.apiSource = apiSource;
}
代码示例来源:origin: io.swagger/swagger-models
public Swagger externalDocs(ExternalDocs value) {
this.setExternalDocs(value);
return this;
}
代码示例来源:origin: apache/servicecomb-java-chassis
@Override
public void process(Object annotation, SwaggerGenerator swaggerGenerator) {
SwaggerDefinition definitionAnnotation = (SwaggerDefinition) annotation;
Swagger swagger = swaggerGenerator.getSwagger();
swaggerGenerator.setBasePath(definitionAnnotation.basePath());
swagger.setHost(definitionAnnotation.host());
convertConsumes(definitionAnnotation, swagger);
convertProduces(definitionAnnotation, swagger);
convertSchemes(definitionAnnotation, swagger);
convertTags(definitionAnnotation, swagger);
convertInfo(definitionAnnotation.info(), swagger);
swagger.setExternalDocs(convertExternalDocs(definitionAnnotation.externalDocs()));
}
代码示例来源:origin: org.ballerinalang/ballerina-to-swagger
/**
* Creates external docs swagger definition.
*
* @param annotationExpression The ballerina annotation attribute value for external docs.
* @param swagger The swagger definition which the external docs needs to be build on.
*/
private void createExternalDocModel(BLangExpression annotationExpression, Swagger swagger) {
if (null != annotationExpression) {
BLangRecordLiteral docAnnotation = (BLangRecordLiteral) annotationExpression;
Map<String, BLangExpression> externalDocAttributes =
ConverterUtils.listToMap(docAnnotation.getKeyValuePairs());
ExternalDocs externalDocs = new ExternalDocs();
if (externalDocAttributes.containsKey(ConverterConstants.ATTR_DESCRIPTION)) {
externalDocs.setDescription(ConverterUtils
.getStringLiteralValue(externalDocAttributes.get(ConverterConstants.ATTR_DESCRIPTION)));
}
if (externalDocAttributes.containsKey(ConverterConstants.ATTR_URL)) {
externalDocs.setUrl(ConverterUtils
.getStringLiteralValue(externalDocAttributes.get(ConverterConstants.ATTR_URL)));
}
swagger.setExternalDocs(externalDocs);
}
}
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-v2
api.setExternalDocs(config.getExternalDocs());
代码示例来源:origin: com.gitblit.fathom/fathom-rest-swagger
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: gitblit/fathom
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: org.apache.servicecomb/swagger-generator-core
@Override
public void process(Object annotation, SwaggerGenerator swaggerGenerator) {
SwaggerDefinition definitionAnnotation = (SwaggerDefinition) annotation;
Swagger swagger = swaggerGenerator.getSwagger();
swaggerGenerator.setBasePath(definitionAnnotation.basePath());
swagger.setHost(definitionAnnotation.host());
convertConsumes(definitionAnnotation, swagger);
convertProduces(definitionAnnotation, swagger);
convertSchemes(definitionAnnotation, swagger);
convertTags(definitionAnnotation, swagger);
convertInfo(definitionAnnotation.info(), swagger);
swagger.setExternalDocs(convertExternalDocs(definitionAnnotation.externalDocs()));
}
代码示例来源:origin: wso2/msf4j
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: org.wso2.msf4j/msf4j-swagger
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: Sayi/swagger-dubbo
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: io.swagger/swagger-jaxrs
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: javagossip/dorado
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
代码示例来源:origin: noboomu/proteus
if (externalDocs == null) {
externalDocs = new ExternalDocs();
swagger.setExternalDocs(externalDocs);
内容来源于网络,如有侵权,请联系作者删除!