It's a good idea to cover your shoulders, knees and wear shoes. You might be a bit warm in the sun, but if you don't adhere to the dress code you won't be let in, even if you've been queueing for hours.
The same dress code applies to the Vatican Museum and Sistine Chapel.