Skip to content

Commit 8b6cb12

Browse files
ECWID-122978 Add translated alt text support
1 parent e249c36 commit 8b6cb12

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
!.idea/codeStyles/codeStyleConfig.xml
44
build/
55
out/
6+
*.iml
67

78
src/test/resources/test.properties
89

src/main/kotlin/com/ecwid/apiclient/v3/dto/product/result/FetchedProduct.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ data class FetchedProduct(
316316
data class GalleryImage(
317317
val id: Long = 0,
318318
val orderBy: Int = 0,
319+
@Deprecated(
320+
message = "Use field 'altText.main' instead",
321+
replaceWith = ReplaceWith("altText.main")
322+
)
319323
val alt: String? = null,
320324
val width: Int = 0,
321325
val height: Int = 0,
@@ -327,7 +331,13 @@ data class FetchedProduct(
327331
val thumbnailUrl: String = "",
328332
val smallThumbnailUrl: String = "",
329333
val borderInfo: BorderInfo? = null,
330-
)
334+
val altText: Alt? = null
335+
) {
336+
data class Alt (
337+
val main: String? = null,
338+
val translated: LocalizedValueMap? = null
339+
)
340+
}
331341

332342
data class ProductMedia(
333343
val images: List<ProductImage> = listOf(),

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedProductRules.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ val fetchedProductNullablePropertyRules: List<NullablePropertyRule<*, *>> = list
8989
IgnoreNullable(FetchedProduct.GalleryImage::alt),
9090
IgnoreNullable(FetchedProduct.GalleryImage::thumbnail),
9191
AllowNullable(FetchedProduct.GalleryImage::borderInfo),
92+
IgnoreNullable(FetchedProduct.GalleryImage::altText),
93+
IgnoreNullable(FetchedProduct.GalleryImage.Alt::main),
94+
IgnoreNullable(FetchedProduct.GalleryImage.Alt::translated),
9295
IgnoreNullable(FetchedProduct.ProductDimensions::height),
9396
IgnoreNullable(FetchedProduct.ProductDimensions::length),
9497
IgnoreNullable(FetchedProduct.ProductDimensions::width),

0 commit comments

Comments
 (0)