A declaratory judgment is a type of legal action that outlines the rights and obligations of each party in a contract.