Is writing my own extension the way to go?

I’m working on using middleman to generate API docs. The data all comes from an http call that returns some JSON. It’s a standard format (swagger) but I need a lot of custom logic to loop through each call and display various parts of what’s inside the JSON hash. Is writing my own middleman extension the way to go? Or is there a much simpler way to write that logic inside my app?