Preheat the oven to 350°F (175°C).
Line a large baking sheet with parchment paper.
Core the apple and dice it very finely.
Place the ripe bananas in a large mixing bowl and mash until mostly smooth.
Add the peanut butter, egg, maple syrup, and vanilla and stir until well combined.
Add the rolled oats, cinnamon, baking powder, and salt.
Stir until the oats are evenly coated.
Fold in the finely diced apple and optional chopped walnuts.
Let the mixture rest for approximately 5 minutes.
Scoop approximately 1/4 cup of mixture for each cookie onto the prepared baking sheet.
Gently flatten and shape each mound because the cookies will not spread significantly during baking.
Bake for 15–18 minutes, until the edges are lightly golden and the centers are set.
Cool on the baking sheet for 5 minutes.
Transfer to a wire rack and continue cooling before serving or storing.