I was able to reproduce your issue and after setting THIS property, the issue went away.
app.UseSwagger(c => { c.SerializeAsV2 = true; });