What code? There are many standards, some are known as codes.
What jurisdiction? If in the US, then the Federal Register may identify a standard or code as a legal requirement.
What application? Is this for a governmental entity, private entity, self-insured, etc.
Most who post on this web site are engineers, few of us are lawyers. The term mandatory sounds rather legal, doesn't it?