Skip to content

Commit ee04585

Browse files
committed
fix: GeocodingSearch is a QueryContentFormat
Caused endpoint to deserialize ProtoBuf as JSON. Also added default null value to format parameter.
1 parent c207054 commit ee04585

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/src/main/kotlin/com/openmeteo/api/common/query/QueryContentFormat.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package com.openmeteo.api.common.query
33
import com.openmeteo.api.common.http.ContentFormat
44

55
interface QueryContentFormat : Query {
6-
val format: ContentFormat
6+
val format: ContentFormat? get() = null
77
}

lib/src/main/kotlin/com/openmeteo/api/geocoding/GeocodingSearch.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.openmeteo.api.geocoding
22

33
import com.openmeteo.api.common.http.ContentFormat
4+
import com.openmeteo.api.common.query.QueryContentFormat
45
import com.openmeteo.api.common.response.ResponseGenerationTimed
56
import kotlinx.serialization.SerialName
67
import kotlinx.serialization.Serializable
@@ -13,9 +14,9 @@ object GeocodingSearch {
1314
open class Query internal constructor(
1415
val name: String,
1516
val count: Int? = null,
16-
val format: ContentFormat? = null,
17+
override val format: ContentFormat? = ContentFormat.ProtoBuf,
1718
val language: String? = null,
18-
) : com.openmeteo.api.common.query.Query {
19+
) : QueryContentFormat {
1920

2021
constructor(
2122
name: String,

0 commit comments

Comments
 (0)