omdbapi/OMDb-API

All fields are Strings

brady-aiello opened this issue · 0 comments

All of the fields returned in the response are Strings, including year, imdbRating, and Metascore. This makes sorting more difficult, because they need to be deserialized, and then they also need to be transformed. Nullable fields should also not be Strings with "N/A" for null values. Proposed changes:

  1. year -> Int
  2. Released (Date) -> Long
  3. imdbRating -> Float
  4. imdbVotes -> Int
  5. Metascore -> Int
  6. DVD (Date) -> Long
  7. BoxOffice -> Int (assuming USD or another specific currency)
  8. Production -> String? ("N/A" -> null
  9. Website -> String? ("N/A" -> null
  10. Response -> Boolean ("True" -> true)
  11. Rating.Value -> Float, ie
  "Ratings": [
    {
      "Source": "Internet Movie Database",
      "Value": "7.4/10"
    },
    {
      "Source": "Rotten Tomatoes",
      "Value": "40%"
    },
    {
      "Source": "Metacritic",
      "Value": "33/100"
    }
  ]

->

  "Ratings": [
    {
      "Source": "Internet Movie Database",
      "Value": 7.4
    },
    {
      "Source": "Rotten Tomatoes",
      "Value": 40.0
    },
    {
      "Source": "Metacritic",
      "Value": 33.0
    }
  ]