This was not considered to restrict aerial bombardment as early as the first world war, drawing on precedent based on naval bombardments which
could target undefended facilities provided they were of a milirary nature.
Article 2
of the Hague Convention No. IX of 1907 on naval bombardments in
time of war allowed naval forces to fire on certain objects even when
the locality concerned was not defended.
[snip]
Generally speaking, it was possible to
observe a steady shift, for bombardment to be permissible under inter-
national law, from the requirement that a locality be defended to that
of the presence of a military objective. 5 By the time the First World
War ended, therefore, the law of air warfare had virtually lost its sole
codified basis: the prohibition on dropping explosives from aircraft had
become invalid and Article 25's field of application had turned out to
be extremely narrow. It had been replaced by the very imprecise prin-
ciple of the "military objective"
If you continue reading that document it becomes clear there were multiple attempts the codify the rules (eg the Washington Conference talks, the Hague Commission of Jurists) none of which were ratified.
However, the 1922/23 "Hague Rules of Air Warfare" (which were not ratified) are notable in that the discard the idea that defense makes any difference and switched entirely to the military objectives view, with carve-outs to try to protect civilians and monuments.
https://international-review.icrc.org/sites/default/files/S0...