In the world of Game of Thrones, it was a well-kept secret that Jon Snow was not a Stark bastard, but a Targaryen by blood. While Jon himself discovered this truth in season 8, there were several characters who knew about his parentage even before he did.
The first character to know was Ned Stark, Jon's supposed father, who made a promise to his dying sister, Lyanna Stark, to protect her son. Ned raised Jon as his own, hiding his true parentage from the world. Another character who knew was Howland Reed, a friend of Ned's, who was present when Lyanna died. Although it was never explicitly stated, it can be inferred that Howland knew the truth about Jon.
Bran Stark, who had the ability to see the past, discovered Jon's parentage through visions. He saw that Jon was the son of Lyanna Stark and Rhaegar Targaryen, and eventually confirmed this to Jon in season 7. Samwell Tarly, Jon's best friend, also learned about his true parentage from Bran. Sam had previously stumbled upon a book that revealed the annulment of Rhaegar's marriage and his subsequent secret marriage to Lyanna.
There were also rumors and speculations about Jon's mother. Wylla, a wet nurse who served House Dayne, was mentioned in passing, but it is unclear if she is truly Jon's mother. Ashara Dayne, another rumored mother, supposedly died by suicide. If either of these women is revealed to be Jon's mother in the books, it would suggest that they knew the truth about his parentage.
In the end, Jon's Targaryen lineage did not have a significant impact on the plot of Game of Thrones. While it set up high stakes and a potential conflict with Daenerys for the Iron Throne, Jon's character took a backseat in the final seasons. However, his Targaryen heritage might play a more significant role in the upcoming spinoff series, House of the Dragon, which delves deeper into the Targaryen family history.
Overall, while Jon Snow's Targaryen identity was known by a few key characters before he found out himself, its relevance to the story and its impact on his character arc were limited in the final seasons of Game of Thrones.