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(); }
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); }