Esphome - publish rf codes in mqtt

Why is this automatically working?

remote_receiver:
  pin:
    number: GPIO4
    inverted: True
    mode: INPUT_PULLUP
  dump: raw
  tolerance: 60%
  filter: 4us
  idle: 4ms
  

and this not?

remote_receiver:
  pin:
    number: GPIO4
    inverted: True
    mode: INPUT_PULLUP
  dump: rc_switch
  tolerance: 60%
  filter: 4us
  idle: 4ms

The dump: raw also dumps it to mqtt. But then setting it to a specific protocol, than it stops sending to mqtt.

Are there tips where to find information how to make the yaml when wanting to make something that is not default in esphome?

I have searched and found some threads. A lot of them are saying, it is on the esphome pages defined. But i think i am not looking a the right place. Because i can find nothing that says something about this way of making the yaml, to retreive the raw data of protocols