Fix logic issue in RestParameter

I assume any ide will warn about this, but anyway I just checked and it's fixed in my PR already. So it doesn't need to be fixed here.