Out of nowhere James says this in James 5:12:
Above all, my brothers, do not swear–not by heaven or by earth or by
anything else. Let your “Yes” be yes, and your “No,” no, or you will be
condemned.
He has virtually quoted Jesus here. Here are the words of Jesus from Matthew 5:33-37:
Again, you
have heard that it was said to the people long ago, ‘Do not break your
oath, but keep the oaths you have made to the Lord.’ But I tell you, Do not swear at all: either by heaven, for it is God’s throne; or by the earth, for it is his footstool; or by Jerusalem, for it is the city of the Great King. And do not swear by your head, for you cannot make even one hair white or black. Simply let your ‘Yes’ be ‘Yes,’ and your ‘No,’ ‘No’; anything beyond this comes from the evil one.
There are differences between the two, but the similarities are so strong one has to see James as dependent upon his older brother.
But the odd thing is “Above all.” Why would not swearing and why would honestly now all of a sudden take the front row seat in James’ ethical vision? Yes, James does speak often about speech patterns; yes, this verse can be connected to that. But this verse is not about “how to speak with one another” but about legal oaths. Many (Mussner, John White, Moo) that this “above all” is a near equivalent with “finally” or even “before I forget.” Not taking oaths cannot be the most important principle in ethics, for James has given that to loving the neighbor (cf 1:25; 2:8-10).
However you take that expression, the point is the same: tell the truth, whether in court or anywhere else. There’s an anabaptist simplicity here about how to speak: tell the truth.