The War Caster feat allows a single-target spell (“must target only that creature”) to be cast instead of a melee strike for an opportunity attack.
Green-Flame Blade appears to have a single target, and then some damage “leaps” onto a creature 5 feet away. The other creature is never referred to as the target, or even “a target”.
I’m pretty sure this is solid from the RAW perspective. Is this legit from a RAI perspective?