Minecraft wiki entry for Swamp_hut, associated text: The "hut" part of a swamp hut generates on or above the surface, while the wood "pillars" extend down until they reach solid ground. This means that if part of a swamp hut is at sea level and another part is on top of deep ground, such as a ravine, the pillars on the deep-ground side go all the way down to the bottom.
It is possible for swamp huts to generate on top of one another.
Swamp huts are one of five generated structures that do not generate loot chests (the others are desert wells, fossils, nether fossil and ocean monuments).
Swamp huts, together with nether fortresses, ocean monuments and pillager outposts, are the only four generated structures in the game that have special spawning rules within their bounding boxes.
Dungeons are not included, since the spawning condition is dictated by the spawner rather than the dungeon structure.