Skip to content

CIOFilterFacet - Missing status property - Inconsistent property types between the Android and iOS SDK! #245

@kim-nguyen-momox

Description

@kim-nguyen-momox

The SDK did not declare the status property in the CIOFilterFacet struct and thus ignored it in the response

  • Example of a real-life response
{
    "display_name": "price_amount",
    "name": "price_amount",
    "data": {},
    "type": "range",
    "hidden": false,
    "status": {
        "min": 44.0,
        "max": 79.0
    },
    "min": 0,
    "max": 126.9
}
public struct CIOFilterFacet {
    /**
     Display name of the facet
     */
    public let displayName: String

    /**
     The name (or value) of the facet
     */
    public let name: String

    /**
     The max possible value for the facet (if it's of type range)
     */
    public let max: Int

    /**
     The minimum possible value for the facet (if it's of type range)
     */
    public let min: Int

    /**
     List of facet options
     */
    public let options: [CIOFilterFacetOption]

    /**
     The type of the facet (i.e. range or multiple)
     */
    public let type: String

    /**
     Whether the facet is hidden or not  (i.e. true or false)
     */
    public let hidden: Bool

    /**
     Additional metadata for the facet option
     */
    public let data: [String: Any]

}
  • The min and max are declared as Int
  • At the same time, the Android SDK declared min and max as Double? and has status in the data class
data class FilterFacet(
       @Json(name = "display_name") val displayName: String?,
       @Json(name = "name") val name: String,
       @Json(name = "status") val status: Map<String, Any>?,
       @Json(name = "min") val min: Double?,
       @Json(name = "max") val max: Double?,
       @Json(name = "options") val options: List<FilterFacetOption>?,
       @Json(name = "type") val type: String?,
       @Json(name = "hidden") val hidden: Boolean?,
       @Json(name = "data") val data: Map<String, Any?>?,
) : Serializable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions