It seems that the latter is the right one. But, the former one is more reasonably by grammar?
Anyway, it should be a noun.
German Language Stack Exchange is a bilingual question and answer site for speakers of all levels who want to share and increase their knowledge of the German language. It's 100% free, no registration required.Sign up to join this community
Both versions are correct, but there is a subtile difference in Meaning. So subtile, that most speakers are not aware of it, but I'll show you:
Here »Recht« is a noun, that you also could use with an article, but this is not usual in German:
Du hast (das) Recht.
You have (the) right.
But in ...
The word recht is an adjective in adverbial usage. Like almost all adjectives, you can use this adjective:
Mach weiter so, du bist auf dem rechten Weg.
Go on, you are on the right way.
Es war nicht recht, ihn fortzujagen.
It was not right to chase him away.
Du hast recht.
You are right.
The recommended version is the lowercase version: »Du hast recht.« But both versions are correct.