Check for operation parameters first before iterating

I'm using this downstream via *swagger-angular-client*. This is breaking my app when I try to use it for get requests that don't have any parameters.