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


Java ModelImpl.setType方法代码示例

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


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

示例1: toRefModel

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private RefModel toRefModel(String modelType) {
  if (RefProperty.class.isInstance(property)) {
    return (RefModel) PropertyBuilder.toModel(property);
  }

  ModelImpl modelImpl = new ModelImpl();
  modelImpl.setType("object");
  modelImpl.setName(name);
  modelImpl.addProperty(name, property);

  operationGenerator.getSwagger().addDefinition(modelType, modelImpl);

  RefModel refModel = new RefModel();
  refModel.setReference("#/definitions/" + modelType);

  return refModel;
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:18,代码来源:PendingBodyParameter.java

示例2: createBodyParameter

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private List<Parameter> createBodyParameter(String object) {
  BodyParameter bodyParameter = new BodyParameter();
  ModelImpl schema = new ModelImpl();
  schema.setType(object);
  bodyParameter.setSchema(schema);
  List<Parameter> parameters = new ArrayList<>();
  parameters.add(bodyParameter);
  return parameters;
}
 
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:10,代码来源:OpenApiRequestMapperTest.java

示例3: build

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
public Model build() {
    ModelImpl model = new ModelImpl();
    model.setType(type);
    
    Map<String, Property> properties = new HashMap<>();
    
    for(Entry<String, PropertyBuilder> entry: propertyBuilders.entrySet()){
    	properties.put(entry.getKey(), entry.getValue().build());
    }
    
    model.setProperties(properties);
    return model;
}
 
开发者ID:pegasystems,项目名称:api2swagger,代码行数:14,代码来源:ModelBuilder.java

示例4: processListsFromProperties

import io.swagger.models.ModelImpl; //导入方法依赖的package包/类
private Map<String, Model> processListsFromProperties(Collection<Property> properties, Model baseModel, Swagger swagger) {

        Map<String, Model> result = new LinkedHashMap<>();

        for (Property p : properties) {
            if (p != null && "array".equals(p.getType())) {

                ArrayProperty arrayProperty = (ArrayProperty) p;
                if ( arrayProperty.getItems() instanceof RefProperty) {
                    RefProperty ref = (RefProperty) arrayProperty.getItems();

                    String baseName = ref.getSimpleRef();

                    // Do not generate List wrappers for primitives (or strings)
                    if (!languageSpecificPrimitives.contains(baseName) && topLevelResources.contains(baseName)) {

                        String modelName = baseName + "List";

                        ModelImpl model = new ModelImpl();
                        model.setName(modelName);
                        model.setAllowEmptyValue(false);
                        model.setDescription("Collection List for " + baseName);

                        if (baseModel == null) {
                            baseModel = swagger.getDefinitions().get(baseName);
                        }

                        // only add the tags from the base model
                        if (baseModel.getVendorExtensions().containsKey("x-okta-tags")) {
                            model.setVendorExtension("x-okta-tags", baseModel.getVendorExtensions().get("x-okta-tags"));
                        }

                        model.setVendorExtension("x-isResourceList", true);
                        model.setVendorExtension("x-baseType", baseName);
                        model.setType(modelName);

                        result.put(modelName, model);
                    }
                }
            }
        }

        return result;
    }
 
开发者ID:okta,项目名称:okta-sdk-java,代码行数:45,代码来源:AbstractOktaJavaClientCodegen.java


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