I was thinking - while publishing or subscribing to a LightningMessageChannel, the payload has to be in some way match exactly to the names or fields defined in the lightningMessageFields XML definition of the channel. Found out my code/components are working without any consideration to the actual names used in the lightningMessageFields. Whatever I send to the channel( by any name ) I can get back and process in the subscribing component. Am I doing something wrong here or is there any special benefit sticking to the fields defined? if so where can I find details of usage patterns for this specific aspect of LightningMessageChannel fields?
It is correct and as per design that the LightningMessageChannel fields are not reference-checked and you can add in a message field in the message of your choice. While the channel name is strictly checked!
It's left as it is for now but hopefully, in the future (safe harbor) there is an additional switch to toggle this behavior!