当前位置: 首页>>代码示例>>Java>>正文


Java Property.setDescription方法代码示例

本文整理汇总了Java中io.swagger.models.properties.Property.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Property.setDescription方法的具体用法?Java Property.setDescription怎么用?Java Property.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.swagger.models.properties.Property的用法示例。


在下文中一共展示了Property.setDescription方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseResponseHeaders

import io.swagger.models.properties.Property; //导入方法依赖的package包/类
private static Map<String, Property> parseResponseHeaders(ReaderContext context,
		ResponseHeader[] headers) {
	Map<String, Property> responseHeaders = null;
	for (ResponseHeader header : headers) {
		final String name = header.name();
		if (StringUtils.isNotEmpty(name)) {
			if (responseHeaders == null) {
				responseHeaders = new HashMap<String, Property>();
			}
			final Class<?> cls = header.response();
			if (!ReflectionUtils.isVoid(cls)) {
				final Property property = ModelConverters.getInstance().readAsProperty(cls);
				if (property != null) {
					final Property responseProperty = ContainerWrapper.wrapContainer(
							header.responseContainer(), property, ContainerWrapper.ARRAY,
							ContainerWrapper.LIST, ContainerWrapper.SET);
					responseProperty.setDescription(header.description());
					responseHeaders.put(name, responseProperty);
					appendModels(context.getSwagger(), cls);
				}
			}
		}
	}
	return responseHeaders;
}
 
开发者ID:Sayi,项目名称:swagger-dubbo,代码行数:26,代码来源:DubboReaderExtension.java

示例2: parseResponseHeaders

import io.swagger.models.properties.Property; //导入方法依赖的package包/类
private static Map<String, Property> parseResponseHeaders(Swagger swagger, ReaderContext context, ResponseHeader[] headers) {
    Map<String, Property> responseHeaders = null;
    for (ResponseHeader header : headers) {
        final String name = header.name();
        if (StringUtils.isNotEmpty(name)) {
            if (responseHeaders == null) {
                responseHeaders = new HashMap<String, Property>();
            }
            final Class<?> cls = header.response();
            if (!ReflectionUtils.isVoid(cls)) {
                final Property property = ModelConverters.getInstance().readAsProperty(cls);
                if (property != null) {
                    final Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(),
                            property, ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET);
                    responseProperty.setDescription(header.description());
                    responseHeaders.put(name, responseProperty);
                    appendModels(swagger, cls);
                }
            }
        }
    }
    return responseHeaders;
}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:24,代码来源:ControllerReaderExtension.java

示例3: injectResultContainerModel

import io.swagger.models.properties.Property; //导入方法依赖的package包/类
private ModelImpl injectResultContainerModel(Swagger swagger, ModelImpl innerModel, SwaggerRefPropertyFactory.PropertyContainerType containerType) {
  // Only inject result container model once.
  if (innerModel.getName().startsWith(resultContainerName)) {
    return null;
  }

  // Create result container model instance based on result container definition.
  Model model = swagger.getDefinitions().get(resultContainerName);
  if (model == null || !(model instanceof ModelImpl)) {
    return null;
  }
  ModelImpl resultContainerModel = (ModelImpl) model.clone();

  // Set unique name of result container model per container type to avoid overwriting documentation.
  resultContainerModel.setName(resultContainerName + "-" + innerModel.getName() + "-" + containerType);
  // Inject innerModel into 'data' property.
  Property dataProperty = SwaggerRefPropertyFactory.create(containerType, innerModel);
  dataProperty.setRequired(true);
  dataProperty.setDescription(createDataPropertyDescription(containerType));
  resultContainerModel.addProperty(resultContainerDataProperty, dataProperty);
  // Put result container model with injected innerModel into Swagger.
  swagger.addDefinition(resultContainerModel.getName(), resultContainerModel);

  return resultContainerModel;
}
 
开发者ID:mnemonic-no,项目名称:common-services,代码行数:26,代码来源:ResultContainerTransformation.java

示例4: getDescription_ReturnsResponseDescription_ForInputResponse

import io.swagger.models.properties.Property; //导入方法依赖的package包/类
@Test
public void getDescription_ReturnsResponseDescription_ForInputResponse() {
  // Arrange
  Property property = new ResponseProperty(new Response().description("foo"));
  property.setDescription("bar");

  // Act
  String result = property.getDescription();

  // Assert
  assertThat(result, is("foo"));
}
 
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:13,代码来源:ResponsePropertyTest.java


注:本文中的io.swagger.models.properties.Property.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。