File tree Expand file tree Collapse file tree
main/kotlin/com/ecwid/apiclient/v3/dto/storage
test/kotlin/com/ecwid/apiclient/v3/entity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ data class StorageDataUpdateRequest(
1515 updatedStorageData.key,
1616 ),
1717 httpBody = HttpBody .ByteArrayBody (
18- bytes = updatedStorageData.value.toByteArray(),
18+ bytes = updatedStorageData.value? .toByteArray() ? : ByteArray ( 0 ),
1919 mimeType = MIME_TYPE_APPLICATION_JSON ,
2020 ),
2121 )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.dto.storage.result.FetchedStorageData
55
66data class UpdatedStorageData (
77 val key : String = " " ,
8- val value : String = " " ,
8+ val value : String? = null ,
99) : ApiUpdatedDTO {
1010
1111 override fun getModifyKind () = ApiUpdatedDTO .ModifyKind .ReadWrite (FetchedStorageData ::class )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.ecwid.apiclient.v3.dto.storage.request.UpdatedStorageData
55
66data class FetchedStorageData (
77 val key : String = " " ,
8- val value : String = " " ,
8+ val value : String? = null ,
99) : ApiFetchedDTO {
1010
1111 override fun getModifyKind () = ApiFetchedDTO .ModifyKind .ReadWrite (UpdatedStorageData ::class )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class StorageTest : BaseEntityTest() {
3030 val storageEntity = apiClient.getStorageData(storageEntityRequest)
3131 assertEquals(updatedStorageEntity, storageEntity.toUpdated())
3232
33- val fetchedData = StorageApiData .fromJson(storageEntity.value)
33+ val fetchedData = storageEntity.value?. let { StorageApiData .fromJson(it) }
3434 assertEquals(updateData, fetchedData)
3535
3636 val deleteRequest = StorageDataDeleteRequest (key)
You can’t perform that action at this time.
0 commit comments