コード例 #1
0
 private Optional<Model> mapModel(ModelContext parentContext, ResolvedType resolvedType) {
   if (isMapType(resolvedType) && !parentContext.hasSeenBefore(resolvedType)) {
     String typeName = typeNameExtractor.typeName(parentContext);
     return Optional.of(
         parentContext
             .getBuilder()
             .id(typeName)
             .type(resolvedType)
             .name(typeName)
             .qualifiedType(ResolvedTypes.simpleQualifiedTypeName(resolvedType))
             .properties(new LinkedHashMap<String, ModelProperty>())
             .description("")
             .baseModel("")
             .discriminator("")
             .subTypes(new ArrayList<String>())
             .build());
   }
   return Optional.absent();
 }
コード例 #2
0
 private Model modelBuilder(
     ResolvedType propertiesHost,
     Map<String, ModelProperty> properties,
     ModelContext modelContext) {
   String typeName =
       typeNameExtractor.typeName(ModelContext.fromParent(modelContext, propertiesHost));
   modelContext
       .getBuilder()
       .id(typeName)
       .type(propertiesHost)
       .name(typeName)
       .qualifiedType(ResolvedTypes.simpleQualifiedTypeName(propertiesHost))
       .properties(properties)
       .description("")
       .baseModel("")
       .discriminator("")
       .subTypes(new ArrayList<String>());
   return schemaPluginsManager.model(modelContext);
 }