getTypeDefinition() should consider discriminator