Catalyzes the conversion of 4-hydroxy-tetrahydrodipicolinate (HTPA) to tetrahydrodipicolinate. (S)-2,3,4,5-tetrahydrodipicolinate + H2O + NAD(+) = (2S,4S)-4-hydroxy-2,3,4,5-tetrahydrodipicolinate + H(+) + NADH (S)-2,3,4,5-tetrahydrodipicolinate + H2O + NADP(+) = (2S,4S)-4-hydroxy-2,3,4,5-tetrahydrodipicolinate + H(+) + NADPH Amino-acid biosynthesis; L-lysine biosynthesis via DAP pathway; (S)-tetrahydrodipicolinate from L-aspartate: step 4/4. Belongs to the DapB family. Was originally thought to be a dihydrodipicolinate reductase (DHDPR), catalyzing the conversion of dihydrodipicolinate to tetrahydrodipicolinate. However, it was shown in E.coli that the substrate of the enzymatic reaction is not dihydrodipicolinate (DHDP) but in fact (2S,4S)-4-hydroxy-2,3,4,5-tetrahydrodipicolinic acid (HTPA), the product released by the DapA-catalyzed reaction.