The reasons behind two controversial peerages awarded by Boris Johnson have been published after an 18-month freedom of information battle.