The 21-year-old joined the Millers on loan in January and has made two appearances so far.
Bray never played a first-team game for the Swans but did appear five times for the club's under-21 side in the EFL Trophy this season.
Rotherham are bottom of the Championship, 19 points adrift of safety.
Find all the latest football transfers on our dedicated page.

The 18-year-old has played 18 games since making his debut in the 2-0 loss to Leeds in January and made his first start against Rotherham a week later.
Brereton came off the bench to score his first Forest goal in the dramatic 2-1 win over Aston Villa in February.
"It is a great club to be at and I can't wait to find out what the future holds," he told the club website.
"It was good to break through into the first team. It was tough as well but people believed in me and I was given my opportunity and thankfully I took it."
Brereton joined Forest from Stoke in 2015 and is an England Under-19 international.
Colin Fray, BBC Radio Nottingham's Forest correspondent
After a summer of positivity so far for Forest fans following the takeover by Evangelos Marinakis, this is more news that they wanted to hear.
Brereton burst brilliantly onto the first-team scene in 2016-17, and there was concern that he might be stolen away from Forest by one of the host of Premier League clubs that have been linked with him.
There is huge excitement about Brereton as a player. He already has pace and power in abundance, he is a menace to defenders and has proved he can make the step up to senior level in terms of goalscoring too. His injury-time winner against Villa was one of the highlights of last season.
To get his new contract finalised is another very positive step by the new owners. Brereton is one of the most exciting talents to have played for the club for years.
Happy Forest fans can now look forward to watching him develop for a few more seasons or, at worst, seeing the club receive a major transfer fee if he does leave.

Healthwatch Oxfordshire also highlights staff fears that "workforce pressures" are making it harder for them to deliver acceptable levels of care.
Its report, written with Age UK, was based on 161 patients and 57 staff completing questionnaires, as well as six focus groups and 10 case studies.
The majority of patients were still treated with dignity, the report added.
Patients with communication difficulties and dementia were particularly unhappy with their care.
One patient, who had suffered a stroke, said she was left for hours in her own excrement.
She said: "I was sedated and my health needs were neglected."
Another described finding her mother-in-law, who has Alzheimer's, "soaked, dirty" and ignored by nurses.
Their report said that, in a small number of cases, their experiences were "shocking".
A woman who suffers from trigeminal neuralgia, a condition which causes severe facial pain, said that while she was normally treated with respect, on one occasion she was called "unclean" by a staff member when she was in too much pain to wash.
Healthwatch also found people were often reluctant to complain and did not always feel properly involved in decisions about their care.
But 93% of patients who responded said they had been treated with dignity or respect "some of the time", "most of the time" or "always".
While patients were receiving "a high level of dignity in their care", Healthwatch chief executive Rachel Coney said there was "still much that can be improved about how people are treated".
The report, written in partnership with charity Age UK, said the county's care organisations have made commitments to improve.
These include drawing up formal dignity standards, reviewing staff training, and involving patients more in decision making.
Rotherham United have signed Swansea winger Alex Bray for an undisclosed fee until the end of the 2018-19 season.
[NEXT_CONCEPT]
Teenage Nottingham Forest striker Ben Brereton has signed a new contract which will keep him at club until 2021.
[NEXT_CONCEPT]
"Shocking" cases of patients not being treated with dignity in care have been uncovered by a health watchdog.