There are 2 separate wires on most door position switches (maybe a 3rd ground wire if the switch grounding has an isolated door cavity connection wire), one goes to the body control module for the dome light, the 2nd wire goes to the factory security control / key in door buzzer module. These two wires connect the door position switch to chassis ground. So you may have already determined that the door switch is bad if both DPST tabs on the switch don't show (zero) ohms to chassis ground with an ohm meter. Of course there is +12VDC back to the switch connector, that's the body control module dome light circuit feeding HOT +12 VDC back through the cabin light bulb filaments or control relay back to the door switch. If your car has the switch integral to the door latch, when the switch goes bad, you have to replace the entire door latch mechanism. If it does have a door jamb pin switch, you will have an easy fix, the internal door latch mechanism requires a complete door tear apart into the internal door cavity to repair.
There's more wires on a powered tailgate latch for electrical solenoid opening operation purposes, I have replaced many of those.
The third ground wire is prevalent on fiberglass Jeep Cherokee tailgates where there is no metallic mounting ground for the latch.
One of the 2 wires shorted to ground will illuminate the dome light, tag onto that wire with a switch to chassis ground for your fix.
Most vehicles have a way to do this via the dash light dimmer SW twisted fully clockwise to turn the dome light circuit on manually.