UX generalist versus UX specialist has to be one of the most commonly discussed topics in the UX community.
Personally, I like the idea of being a generalist rather than a specialist. That's probably obvious if you've read my resume, where I described myself as a generalist using the idea of key-shaped versus T-shaped people. And it's not just T-shaped or key-shaped: it's always going to be this versus that: T-shaped versus I-shaped, E-shaped versus T-shaped. I won't be surprised if someone invents new letters to make the same cross-competency argument some day. (Side note: stop discriminating against letters, you monsters. Every letter was created equal.) The underlying idea is the same either way: be extremely good at one discipline, or be good in one field alongside some knowledge of closely related ones.
So unlike the traditional "jack of all trades and master of none" principle, I like the idea of a jack of all trades who is also a master (or somewhere close to it) of one UX discipline.
For the engineers reading, the simplest comparison is with a full-stack developer: would you rather do everything yourself, or specialise in one part of the stack? It's nice to be extremely good at one UX field (interaction design, say, or user testing) but when you work with cross-disciplinary people you need at least some knowledge of user research, prototyping and the other design thinking approaches.
My reasoning, as someone starting out, is that there's a limited chance of establishing yourself as a specialist until you've been polished by all that "UXness" in the real world. To gain that experience, you have to start as a generalist. You might not be the sharpest tool in the shed, but you'll always have something you're really good at. Starting as a generalist also gives you the insight to decide what you want to specialise in later, and it keeps you across where UX is going and what's coming next. One problem I've seen with specialists is that they dive deep into their specialism, discover it isn't what they're passionate about, and find themselves frustrated, and sometimes specialising closes off wider career options.
This post is biased, obviously, since it's written by a generalist. But the real problem isn't generalist versus specialist. Some startups and hiring managers aren't looking for either. They're after a creature that doesn't generalise in everything but specialises in one aspect of UX: the mythical UX unicorn who specialises in every aspect of design: research, information architecture, prototyping, UI, interaction design, usability testing, front-end development, project management, and everything else they can think of. These unicorns are supposed to magically touch a product and sprinkle pixie dust on the UX and UI to make it look and work amazing. Oh, and don't forget the "five years' experience in a UX design or research role, preferably as a lead".
These hiring managers have 99 problems, but whether to hire a generalist or a specialist ain't one. Being a generalist might cover the surface of the job description, but that's just the tip of the iceberg generalists are dealing with. These are jobs that need a generalist alongside a couple of specialists. If a hiring manager insists on hunting unicorns, they might not find one, or they'll end up with someone running a "fake it till you make it" philosophy.
Minor gripes aside, whether to be a UX generalist, a specialist, or a unicorn if you can pull it off, shouldn't be a problem. Both are equally necessary and in demand.
If you're a hiring manager or a startup looking for unicorns: I've heard they're usually found in the misty mountains next to the portal of unlimited creative freedom, i.e. not in your company. Good luck recruiting them.