@@ -52,7 +52,7 @@ data class YamlSwipeElement(
5252
5353data class YamlRelativeCoordinateSwipeElement (
5454 val from : YamlElementSelectorUnion ,
55- val end : String ,
55+ val to : String ,
5656 override val duration : Long = DEFAULT_DURATION_IN_MILLIS ,
5757 override val label : String? = null ,
5858 override val optional : Boolean ,
@@ -96,8 +96,7 @@ class YamlSwipeDeserializer : JsonDeserializer<YamlSwipe>() {
9696 mapper.convertValue(root, YamlSwipeElement ::class .java)
9797 }
9898 }
99- input.contains(" from" ) && input.contains(" end" ) -> {
100- // Handling YamlRelativeCoordinateSwipeElement
99+ input.contains(" from" ) && input.contains(" to" ) -> {
101100 return resolveRelativeCoordinateSwipeElement(root, duration, label, optional, mapper)
102101 }
103102 else -> {
@@ -122,26 +121,26 @@ class YamlSwipeDeserializer : JsonDeserializer<YamlSwipe>() {
122121 mapper : ObjectMapper
123122 ): YamlRelativeCoordinateSwipeElement {
124123 val from = mapper.convertValue(root.path(" from" ), YamlElementSelectorUnion ::class .java)
125- val end = root.path(" end " ).toString().replace(" \" " , " " )
124+ val to = root.path(" to " ).toString().replace(" \" " , " " )
126125
127- val isRelative = end .contains(" %" )
126+ val isRelative = to .contains(" %" )
128127
129128 if (isRelative) {
130- val endPoints = end
129+ val endPoints = to
131130 .replace(" %" , " " )
132131 .split(" ," )
133132 .map { it.trim().toInt() }
134133 check(endPoints[0 ] in 0 .. 100 && endPoints[1 ] in 0 .. 100 ) {
135- " Invalid end point: $end should be between 0 to 100 when using relative coordinates."
134+ " Invalid end point: $to should be between 0 to 100 when using relative coordinates."
136135 }
137136 } else {
138- val endPoints = end
137+ val endPoints = to
139138 .split(" ," )
140139 .map { it.trim().toInt() }
141- check(endPoints.size == 2 ) { " Invalid format for absolute coordinates: $end " }
140+ check(endPoints.size == 2 ) { " Invalid format for absolute coordinates: $to " }
142141 }
143142
144- return YamlRelativeCoordinateSwipeElement (from, end , duration, label, optional)
143+ return YamlRelativeCoordinateSwipeElement (from, to , duration, label, optional)
145144 }
146145
147146 private fun resolveCoordinateSwipe (root : TreeNode , duration : Long , label : String? , optional : Boolean ): YamlSwipe {
0 commit comments