Skip to content

Commit 2374050

Browse files
authored
Send tags as String JSON array instead of list of form URL encoded args (#70)
1 parent ed31fba commit 2374050

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
### Removed
3131
- No removed features!
3232
### Fixed
33-
- No fixed issues!
33+
- Fixed tags not being sent as String JSON array
3434
### Security
3535
- No security issues fixed!
3636

src/main/kotlin/com/hyperdevs/poeditor/gradle/network/PoEditorApiController.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class PoEditorApiControllerImpl(private val apiToken: String,
5757
private val optionsAdapter: JsonAdapter<List<Options>> =
5858
moshi.adapter(Types.newParameterizedType(List::class.java, Options::class.java))
5959

60+
private val tagsAdapter: JsonAdapter<List<String>> =
61+
moshi.adapter(Types.newParameterizedType(List::class.java, String::class.java))
62+
6063
override fun getProjectLanguages(projectId: Int): List<ProjectLanguage> {
6164
val response = poEditorApi.getProjectLanguages(
6265
apiToken = apiToken,
@@ -85,7 +88,7 @@ class PoEditorApiControllerImpl(private val apiToken: String,
8588
filters = filters?.map { it.name.toLowerCase() },
8689
language = code,
8790
order = order.name.toLowerCase(),
88-
tags = tags,
91+
tags = tagsAdapter.toJson(tags),
8992
options = options
9093
).execute()
9194

src/main/kotlin/com/hyperdevs/poeditor/gradle/network/api/PoEditorApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ interface PoEditorApi {
4949
@Field("type") type: String,
5050
@Field("filters") filters: List<String>? = null,
5151
@Field("order") order: String? = null,
52-
@Field("tags") tags: List<String>? = null,
52+
@Field("tags") tags: String? = null,
5353
@Field("options") options: String? = null): Call<PoEditorResponse<ExportResult>>
5454
}

0 commit comments

Comments
 (0)