I grew up in the Mennonite Church, and for Mennonites, oaths are a no-no. You simply don’t swear oaths. As a kid, I remember feeling a bit nervous about the possibility of needing to go to court and standing up against the hand on the Bible part. What would I do? By law, Anabaptists are not required to swear oaths in court. They can simply give legal affirmations which are defined as follows:
In law, an affirmation is a solemn declaration allowed to those who conscientiously object to taking an oath. An affirmation has exactly the same legal effect as an oath but is usually taken to avoid the religious implications of an oath; it is thus legally binding but not considered a religious oath. 
Besides the fact that affirming “has exactly the same legal effect as an oath,” (Isn’t this what Anabaptists are trying to avoid?), Anabaptists use James 5:12 and Matthew 5:33-37 to argue that oaths are forbidden for Christians. The Mennonite understanding of Christ’s prohibition of oaths is expressed in “Article XV: The Swearing of Oaths” in the 1890 Confession of Faith and Minister’s Manual:
Regarding the swearing of oaths, we believe and confess, that the Lord Jesus has dissuaded his followers from and forbidden them the same; that is, that he commanded them to “swear not at all;” but that their “Yeah” should be “yea,” and their “Nay, nay.” From which we understand that all oaths, high and low, are forbidden; and that instead of them we are to confirm all our promises and covenants, declarations and testimonies of all matters, merely with “Yea that is yea,” and “Nay that is nay;” and that we are to perform and fulfill at all times, and in all things, to every one, every promise and obligation to which we thus affirm, as faithfully as if we had confirmed it with the most solemn oath. And if we thus do, we have the confidence that no one—not even the government itself—will have just cause to require more of us. 
Putting James and Matthew aside, isn’t it obvious that an official legal affirmation acts in the same way as an oath? Additionally, is it fair to say that those who do swear oaths are implying by their oaths that telling the truth other times is less important? Telling the truth is always important, however, there are certain times when the truth must be told with particular seriousness and care (e.g. murder trial).
James 5:12 and Matthew 5:33-37 deserve careful exegesis and thought. I commend to you a sermon I preached in 2020 titled “Does Your Yes Mean Yes?” where I explain in detail what Jesus meant and that he was not forbidding all oaths. I also recommend you carefully consider Westminster Confession of Faith chapter 22. But here are a few additional thoughts.
First, God Himself swears oaths. Why? Are there times that God doesn’t tell the truth? Of course not. The reasoning of the Anabaptists is faulty. God is truth; He can’t lie (Heb. 6:18). God can’t lie, yet God swears oaths to love and comfort believers (Lk. 1:73; Acts 2:30; Gen. 22:16–18; 26:3; Heb. 6:13-20).
Second, Jesus was made a priest by an oath. Consider Hebrews 7:20–22 which says:
For those who formerly became priests were made such without an oath, 21 but this one was made a priest with an oath by the one who said to him: “The Lord has sworn and will not change his mind, ‘You are a priest forever.’ ” 22 This makes Jesus the guarantor of a better covenant.
Third, Jesus himself went beyond “Yea” and “Nay.” The gospels record many things Jesus said, and on many occasions, Jesus said, “Truly, truly I say to you” or “Truly, I say to you.” The word for “truly” is “amen” which adds emphasis to the truth being told. It essentially means, “What I’m about to say is entirely true, so listen carefully.” Why did Jesus often say “Truly, truly” if all that he ever said is true?
Fifth, the New Testament speaks favorably of oaths. Carefully consider Jesus’ reasoning in Matthew 23:16-22. Jesus seems to assume certain oaths are permissible but should be sworn by the authority of God Himself. Paul, in wanting the Thessalonians to learn his letter well, said, “I put you under oath before the Lord to have this letter read to all the brothers” (1 Thess. 5:27). Paul was under a vow in Acts 18:18. Paul also called God as his witness in Romans 1:9 and 2 Corinthians 1:23. John swore an oath in Revelation 10:5-6.
Sixth, many Anabaptists are inconsistent. They take wedding vows, sign official legal covenants/contracts, and make promises to their children. These are all beyond “Yea” and “Nay” and are types of oaths that show love to others.
The Anabaptist position on oaths is simply untenable. We cannot and should not build an entire doctrine off of one or two verses. We must wisely interpret Scripture with Scripture; we must go to other passages to help us understand the one or two verses. The reality is, on certain special occasions, Christians should swear oaths in order to love their neighbor.
Heidelberg 101 asks, “But may we swear an oath by the Name of God in a godly manner?” It answers with Biblical fidelity:
Yes, when the government demands it of its subjects, or when necessity requires it, in order to maintain and promote fidelity and truth to God’s glory and for our neighbor’s good. Such oath-taking is based on God’s Word and was therefore rightly used by saints in the Old and the New Testament.
No, oaths should not be sworn flippantly or often, but when necessity requires it, they are loving. Notice why we should on occasion swear oaths: “in order to maintain and promote fidelity and truth to God’s glory and for our neighbor’s good.” Oaths do not trivialize truth, they maintain and promote it! If we’ve taken an oath, surely we’re more careful to weigh our words. Oaths are an Old and New Testament practice.
Before you start swearing oaths on your mother’s grave or “By the moon and the stars in the skies” like the 90s R & B sensation All-4-One, realize a lawfully sworn oath is calling upon God alone as witness. Heidelberg 102 clarifies:
May we also swear by saints or other creatures? No. A lawful oath is a calling upon God, who alone knows the heart, to bear witness to the truth and to punish me if I swear falsely. No creature is worthy of such honor.
When taking a lawful oath, we call upon God because He alone is witness to all that is in our hearts. He alone can judge. We will never slip anything by Almighty God. He sees and knows all. So, if we lie and break our oath (or vow or promise), God knows and will hold us accountable. We may dupe other human beings, but it is impossible to dupe God.
You make a lot of true statements in your life, but sometimes you add an exclamation point to drive the truth home. An oath is a divinely sanctioned exclamation point. Take oaths selectively. Take them carefully. Take them by God’s great and holy name. And when you take an oath, be conscious of the glory of God and good of your neighbor. With thankfulness, obey the second and ninth commandments. And as Westminster 22:6 says, swear oaths “voluntarily, out of faith, and conscience of duty, in way of thankfulness for mercy received.”  Our “Yea” should be “Yea,” and our “Nay” should be “Nay,” but on special occasions, we love when we add the exclamation point.
 The Confessions of Our Faith, Fortress Edition, ed. Rev. Brian W. Kinney (Fortress Book Service & Publishers, 2007), 40.
Quotes from the Heidelberg Catechism and creeds are taken from Zacharias Ursinus & Jonathan Shirk, The Heidelberg Catechism: True Comfort for Life & Death (Manheim: Small Town Theologian, 2021), 395.
Scripture quotations are from the ESV® Bible (The Holy Bible, English Standard Version®), copyright © 2001 by Crossway, a publishing ministry of Good News Publishers. Used by permission. All rights reserved. May not copy or download more than 500 consecutive verses of the ESV Bible or more than one half of any book of the ESV Bible.