Me and my friend have build an underground base underneath deep ocean biome. We replaced the entire seafloor with glass and removed all stone etc. all the way down to bedrock where we've build a village.. We have +10 villagers atm. that we bred on the surface above ground and moved them underground afterwards - we used an infinite breeder by this principle:
There is also a bug or glitch where the villagers can be coaxed to breed indefinitely without regard to the population cap.
Villagers need to be inside a sphere (radius = village radius) around the village center in order to breed. But the village population counts only villagers that are inside a box (width, length = 2× village radius, height: 9 [always!]) around the village center. So with a sphere that can grow to any size, and a box that's always only 9 high, it should be apparent that there are some zones only covered by the sphere (above and below the village center).
You can reproduce/abuse this behavior by building 6 houses on the ground level (enough to set the villager limit to 2), drop 2 (or more) villagers into a 6 blocks deep hole, and leave one villager at the top to keep the houses "alive". The villagers in the hole will breed indefinitely, because they're not counted against the cap.
I researched everything about villagers mechanics and breeding, and the houses etc. we built are recognized by the villagers since they keep using them at night.
Since our villagers wouldn't breed naturally and we wanted more villagers I tried to set up the infinite breeder again, but this time under sea/ground. However despite making sure I placed all of the 6 doors within 5 blocks of direct connection to sky (we build a glass tower through the water) the villagers still won't breed. The only difference is the farm is under the sea - but the with a glass tower it has direct connection to the sky and shouldn't think there is any problems
We've traded with them countless times, given them STACKS and STACKS of food like potatoes, carrots and bread, yet they never get any hearts and make that sweet sweet villager love and give us more babbies. For all I know they should be in full willingness to breed, but just won't enter mating mode.
I've removed every single door there is within 70 blocks each direction. If we have to we can build the infinite villager breeder above ground again, but I'd rather not since it would be so much cooler to have it underground.