Two American authors have revealed that they were told by a literary agent to "straighten" a gay character in their post-apocalyptic young adult novel if they wished to be represented.

Sherwood Smith and Rachel Manija Brown's co-written YA novel, Stranger, includes the viewpoint of Yuki as one of its five main characters. Yuki is gay and has a boyfriend, with whom he does "nothing more explicit" than kissing. Writing in the US trade magazine Publishers Weekly, the two published authors say they were contacted by an agent from a "major" literary agency, who offered to sign them up "on the condition that we make the gay character straight, or else remove his viewpoint and all references to his sexual orientation".

The demand follows the experience of author Jessica Verday, who pulled out of the young adult anthology Wicked Pretty Things in March after she was told by its editor that her story, "which features Wesley (a boy) and Cameron (a boy), who were both in love with each other, would have to be published as a male/female story because a male/male story would not be acceptable to the publishers".

Like Verday, Smith and Brown refused to "straighten" Yuki, with Brown telling the agent that "making a gay character straight is a line in the sand which I will not cross. That is a moral issue. I work with teenagers, and some of them are gay. They never get to read fantasy novels where people like them are the heroes, and that's not right". The agent suggested that, as a compromise, Yuki could be revealed to be gay in later books, when readers "were already invested in the series". Smith and Brown were unconvinced. "We knew this was a pie-in-the-sky offer - who knew if there would even be sequels? - and didn't solve the moral issue. When you refuse to allow major characters in YA novels to be gay, you are telling gay teenagers that they are so utterly horrible that people like them can't even be allowed to exist in fiction," they said, adding that the agent was not the only one to have requested a rewrite which included cutting the viewpoint of Yuki.

"This isn't about one agent's personal feelings about gay people. We don't know their feelings; they may well be sympathetic in their private life, but regard the removal of gay characters as a marketing issue. The conversation made it clear that the agent thought our book would be an easy sale if we just made that change. But it doesn't matter if the agent rejected the character because of personal feelings or because of assumptions about the market. What matters is that a gay character would be quite literally written out of his own story," they said.

The two authors believe that "forcing all major characters in YA novels into a straight white mould is a widespread, systemic problem which requires long-term, consistent action". They suggest that both editors and agents who are open to novels with lesbian, gay, bisexual and transgender protagonists make this explicit, that readers vote with their pockets and that writers speak out about similar experiences. "How many published novels with a straight white heroine and a lesbian or black or disabled best friend once had those roles reversed, before an agent demanded a change? This does not make for better novels. Nor does it make for a better world. Let's make a better world," they say.

Their revelations about being asked, as novelist Scott Tracey put it, to "straightwash" their character have prompted a storm of comments online, with other authors citing similar experiences. "I fired my first agent because she didn't like the protagonist of my outlined novel being lesbian, [and] said 'This is not a selling outline'," said author Nicola Griffith. "The novel, Slow River went on to win the Nebula award, the Lambda literary award, and others." An anonymous author posted that their publisher, one of the "big six", did not ask for a gay character to be removed – rather "my editor went through and deleted all gay references between my copy-edits and the first-pass pages without bothering to tell me". Tracey, author of Witch Eyes, blogged that he "had agents who said there wasn't a market for a paranormal with a gay character who had a romance. I had editors suggest they would reconsider the book if Braden and Trey became Brenda and Trey. Or if I removed the romance and made it a straight girl/gay guy buddy comedy". The debate has also taken off on Twitter through the hash tag #YesGayYA.

British novelist Malorie Blackman, author of the Noughts and Crosses series for teenagers, said she was "shocked and saddened" by Brown and Smith's experience. Although Blackman experienced only positive reactions from her agent, publisher and readers at her inclusion of a gay younger brother in her novel Boys Don't Cry, she said that, when she was starting out as a writer 20 years ago, she was asked to make a black character white.

"Are we still not over this nonsense?" she said. "I think it's really sad. All power to the writers for sticking to their guns and making sure the character was how they wanted him to be. At the end of the day you have to be true to the story you are telling. When I was asked [to whiten her character] I said no. It seems to me this is more of the same … With all these things it stems from ignorance, and ignorance breeds fear. A good way of tackling this is to show gay or Muslim or black characters in our fiction for children. I grew up with no black characters in the books I read and I missed them. It's part of the reason I became a writer."