Matthew's genealogy states Rahab as the mother of Boaz and the ancestress of David, and ultimately of Jesus Christ. Was this fact known among the Israelites before the writing of Matthew? This fact doesn't seem to occur anywhere in the OT, nor, from what I've been able to see, in pre-Christian Jewish tradition; but it seems like the kind of thing that would've been known from the time of David, and definitely doesn't seem like something God would reveal for the first time when the Gospels are being written. Do we know for certain that this Rahab (whose name in Greek is spelled differently from the spelling in Hebrews 11:31 and James 2:25, which explicitly refer to the Canaanite Rahab) is the same Rahab as the Canaanite Rahab in Joshua? (If so, would this mean God decided to directly reveal a previously unknown piece of information to one of the Gospel writers? And if so, why something like this? The account of Cornelius in Acts 10, for example, seems to suggest that God intends for the Gospel to be told through people rather than by direct revelation. Why should a far less significant detail be revealed by direct revelation?) EDIT: To clear up: So the center of what I was asking was: Tamar, Ruth, and Bathsheba are all explicitly stated in the Old Testament to be in the lineage of David, whereas Rahab is not. Matthew seems to be the first time Rahab was said to be the wife of Salmon and the mother (ancestress?) of Boaz. From a brief google search, I also don't find any Jewish tradition of Rahab being in the lineage of David. In fact, it seems that some Jewish tradition indicates Rahab married Joshua. If the Rahab in Matthew's genealogy really is the same as the Rahab from Joshua (and right now I don't see any other reason she would've been mentioned), would this indicate that the fact that Rahab married Salmon was not preserved in tradition (being replaced by a false tradition of marrying Joshua), and was revealed directly to Matthew? This honestly seems a bit perplexing; why would something minor like a genealogical link be directly revealed, when the Gospel itself was supposed to be spread through people? I think I'm still confused as to how much genealogical fluidity can be assumed in the Biblical text without posing questions of validity.
ESV - 5 And Salmon the father of Boaz by Rahab, and Boaz the father of Obed by Ruth, and Obed the father of Jesse.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.