Incorrect XPM Component field markup when 2+ levels of multivalue embedded fields
If you have a content model which uses 2 levels of multivalue embedded fields (for example schema Article contains multival embedded field Paragraph, which contains multivalue embedded field Link) then the XPM markup generated for the fields within the lowest level is incorrect:
<!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:paragraph[2]/custom:link[1]/custom:link/custom:linkText[1]"} -->
instead of
<!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:paragraph[2]/custom:link[1]/custom:linkText[1]"} -->
I suspect the logic in FieldPath is incorrect somewhere around here: https://github.com/sdl/dxa-web-application-java/blob/58a4fdebafc192b9a87570c684bd97d9091fdc5f/dxa-framework/dxa-common/src/main/java/com/sdl/webapp/common/api/mapping/semantic/config/FieldPath.java#L63