本文整理了Java中io.swagger.models.Swagger.getExternalDocs()
方法的一些代码示例,展示了Swagger.getExternalDocs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Swagger.getExternalDocs()
方法的具体详情如下:
包路径:io.swagger.models.Swagger
类名称:Swagger
方法名:getExternalDocs
暂无
代码示例来源:origin: Swagger2Markup/swagger2markup
@Test
public void testExternalDocsComponent() throws URISyntaxException {
//Given
Path file = Paths.get(DefinitionComponentTest.class.getResource("/yaml/swagger_petstore_20160612.yaml").toURI());
Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(file).build();
Swagger swagger = converter.getContext().getSwagger();
ExternalDocs externalDocs = swagger.getExternalDocs();
Assert.assertNotNull(externalDocs);
Swagger2MarkupConverter.Context context = converter.getContext();
MarkupDocBuilder markupDocBuilder = context.createMarkupDocBuilder();
//When
markupDocBuilder = new ExternalDocsComponent(context).apply(markupDocBuilder, ExternalDocsComponent.parameters(externalDocs, OverviewDocument.SECTION_TITLE_LEVEL));
markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8);
//Then
Path expectedFile = getExpectedFile(COMPONENT_NAME);
DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME));
}
}
代码示例来源:origin: Swagger2Markup/swagger2markup
/**
* Builds the overview MarkupDocument.
*
* @return the overview MarkupDocument
*/
@Override
public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, OverviewDocument.Parameters params) {
Swagger swagger = params.swagger;
Info info = swagger.getInfo();
buildDocumentTitle(markupDocBuilder, info.getTitle());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder));
buildOverviewTitle(markupDocBuilder, labels.getLabel(Labels.OVERVIEW));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder));
buildDescriptionParagraph(markupDocBuilder, info.getDescription());
buildVersionInfoSection(markupDocBuilder, info);
buildContactInfoSection(markupDocBuilder, info.getContact());
buildLicenseInfoSection(markupDocBuilder, info);
buildUriSchemeSection(markupDocBuilder, swagger);
buildTagsSection(markupDocBuilder, swagger.getTags());
buildConsumesSection(markupDocBuilder, swagger.getConsumes());
buildProducesSection(markupDocBuilder, swagger.getProduces());
buildExternalDocsSection(markupDocBuilder, swagger.getExternalDocs());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder));
return markupDocBuilder;
}
代码示例来源:origin: com.reprezen.genflow/genflow-api
if (swagger.getExternalDocs() != null) {
callbacks.externalDocs(swagger.getExternalDocs());
callbacks.any(swagger.getExternalDocs());
代码示例来源:origin: com.holon-platform.jaxrs/holon-jaxrs-swagger-v2
if (api.getExternalDocs() == null) {
api.setExternalDocs(config.getExternalDocs());
代码示例来源:origin: swagger-api/swagger-parser
if (swagger.getExternalDocs() != null) {
openAPI.setExternalDocs(convert(swagger.getExternalDocs()));
代码示例来源:origin: wso2/msf4j
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: io.swagger.parser.v3/swagger-parser-v2-converter
if (swagger.getExternalDocs() != null) {
openAPI.setExternalDocs(convert(swagger.getExternalDocs()));
代码示例来源:origin: org.openapitools.swagger.parser/swagger-parser-v2-converter
if (swagger.getExternalDocs() != null) {
openAPI.setExternalDocs(convert(swagger.getExternalDocs()));
代码示例来源:origin: org.wso2.msf4j/msf4j-swagger
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: io.swagger/swagger-jaxrs
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: javagossip/dorado
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: Sayi/swagger-dubbo
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: noboomu/proteus
ExternalDocs externalDocs = swagger.getExternalDocs();
if (externalDocs == null) {
externalDocs = new ExternalDocs();
代码示例来源:origin: io.github.swagger2markup/swagger2markup
/**
* Builds the overview MarkupDocument.
*
* @return the overview MarkupDocument
*/
@Override
public MarkupDocBuilder apply(MarkupDocBuilder markupDocBuilder, OverviewDocument.Parameters params) {
Swagger swagger = params.swagger;
Info info = swagger.getInfo();
buildDocumentTitle(markupDocBuilder, info.getTitle());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEFORE, markupDocBuilder));
buildOverviewTitle(markupDocBuilder, labels.getLabel(Labels.OVERVIEW));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_BEGIN, markupDocBuilder));
buildDescriptionParagraph(markupDocBuilder, info.getDescription());
buildVersionInfoSection(markupDocBuilder, info);
buildContactInfoSection(markupDocBuilder, info.getContact());
buildLicenseInfoSection(markupDocBuilder, info);
buildUriSchemeSection(markupDocBuilder, swagger);
buildTagsSection(markupDocBuilder, swagger.getTags());
buildConsumesSection(markupDocBuilder, swagger.getConsumes());
buildProducesSection(markupDocBuilder, swagger.getProduces());
buildExternalDocsSection(markupDocBuilder, swagger.getExternalDocs());
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_END, markupDocBuilder));
applyOverviewDocumentExtension(new Context(Position.DOCUMENT_AFTER, markupDocBuilder));
return markupDocBuilder;
}
内容来源于网络,如有侵权,请联系作者删除!