This is wrong. You are only accessing tagged services of NelmioApiDocBundle bundle here. If you want to access it for any bundle, you need to use a compiler pass.