The 20g long aquarium I have is 30"/
But as for a fish to breed in it, have you considered the small shell dwelling cichlids of tanganyika? I have a colony of Neolamprologus Multifasciatus started in a 15g right now. The males max out at 1.5" and the females at 1.25", and they have a peacock's personality. They don't pair off particularly, and several batches of fry and be kept in with the adults. Just have a sandy substrate and a bunch of shells and they'll love it. (Species only tanks, of course)
Another one to try, if you can find them, are Lamprologus Stappersi (Or Meleagris, depending on where you look.) They're a tad bit more aggressive than the multis, and they don't colonize. They generally pair off for life, and raise one batch of fry at a time, but that won't stop them from spawning, so you would have to take the fry out after a few weeks and put them in their own grow out tank. That's why I chose the multis, because I already have too many tanks as it is haha.
Both of these fish are sensitive to water chemistry, and like a PH of 8-9 and very hard water. I didn't do anything special with mine...I just used pure white aragonite for a substrate (did 2-3" of it) which buffered my PH up to 8. Another cichlid you could try would be kribnesis. I don't know much about them, just that a single pair would fit in a 20 long. Swordtails would work, but with most swords reaching 4", your tank would soon be overcrowded.
I love my dwarf cichlids from Tanganyika, so I recommend those. There are many more out there to choose from, just google them. I'm starting a colony of Neolamprologus Brichardi (Fairy Cichlid) on Wednesday as soon as they arrive. Good luck!