Skip to content

Commit

Permalink
Send tags as String JSON array instead of list of form URL encoded ar…
Browse files Browse the repository at this point in the history
…gs (#70)
  • Loading branch information
bogdanzurac authored Aug 28, 2023
1 parent ed31fba commit 2374050
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- No removed features!
### Fixed
- No fixed issues!
- Fixed tags not being sent as String JSON array
### Security
- No security issues fixed!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class PoEditorApiControllerImpl(private val apiToken: String,
private val optionsAdapter: JsonAdapter<List<Options>> =
moshi.adapter(Types.newParameterizedType(List::class.java, Options::class.java))

private val tagsAdapter: JsonAdapter<List<String>> =
moshi.adapter(Types.newParameterizedType(List::class.java, String::class.java))

override fun getProjectLanguages(projectId: Int): List<ProjectLanguage> {
val response = poEditorApi.getProjectLanguages(
apiToken = apiToken,
Expand Down Expand Up @@ -85,7 +88,7 @@ class PoEditorApiControllerImpl(private val apiToken: String,
filters = filters?.map { it.name.toLowerCase() },
language = code,
order = order.name.toLowerCase(),
tags = tags,
tags = tagsAdapter.toJson(tags),
options = options
).execute()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ interface PoEditorApi {
@Field("type") type: String,
@Field("filters") filters: List<String>? = null,
@Field("order") order: String? = null,
@Field("tags") tags: List<String>? = null,
@Field("tags") tags: String? = null,
@Field("options") options: String? = null): Call<PoEditorResponse<ExportResult>>
}

0 comments on commit 2374050

Please sign in to comment.