Update middleware documentation to close #20792