Despite the Yankees’ obvious need to bolster their starting rotation before the trade deadline, general manager Brian Cashman passed on a deal that could have put Robbie Ray in pinstripes.

Clarke Schmidt is part of the reason why.

The 23-year-old, 2017 first-round pick, who reportedly was sought by Arizona in a potential trade package that also included Clint Frazier, has recently demonstrated why the Yankees were reluctant to part with him. Schmidt — the fifth-ranked Yankees prospect, according to MLB Pipeline — pitched a career-high seven shutout innings Monday for High-A Tampa, allowing three hits and three walks, while tying a career high with nine strikeouts.

Schmidt also opened the season in Lakeland, striking out nine in five no-hit innings.

“Some of the guys were laughing about it after the game, saying I really like pitching here,” Schmidt told MiLB.com. “I don’t know what it is exactly. The mound is really good, I like the stadium — it’s a pretty good atmosphere here. I enjoy the park and it was a lot of fun out there tonight, I just hope I don’t have to come here to pitch like that. I want to be able to do that every time out.”

Schmidt, who was limited to eight outings last year after undergoing Tommy John surgery in 2017, has twice been sent to the injured list this season, but has still made 12 appearances, posting a 2.98 ERA, while striking out 65 over 60 1/3 innings. In the best start of his young career, the right-hander faced two batters more than the minimum, and never allowed a runner to reach third base.

“I was holding my [velocity] well right up to the end there, but because of the pitch count and the length, I could definitely feel my legs getting tired under me,” Schmidt said. “But it was really good to be able to get to that mark and staying out there that long was good for me too.”

After deciding to stop throwing his slider early this season, Schmidt brought it back last week.

“I’ve been really working on throwing that slider type one for strikes and to be able to get guys to chase it late in the count, and that’s what I did tonight,” Schmidt said. “I got a lot of chases late or guys swinging through the breaking ball. It was really effective.

“It was just one of those nights where everything was working. In addition to my breaking balls, my changeup was really sharp and my fastball had a lot of life tonight — it was jumping for sure.”