I am making call to HTTP Rest API in elixir
url = "http://localhost:8080/getScoreData"
case HTTPoison.get(url) do
{:ok, %{status_code: 200, body: body}} ->
Logger.info("body is #{inspect(body)}")
overall_score = Jason.decode!(body, as: [%OverallScore{}])
{:ok, overall_score}
end
which in the web browser returns
{
"avgPass": 85.55,
"avgFail": 14.45,
"totalStudents": 80.0,
"myScoreSchema": [
{
"average": 80.0,
"count": 8.0,
"percent": 80.0,
"name": "John"
},
{
"average": 0.0,
"count": 0.0,
"percent": 0.0,
"name": "Cena"
},
{
"average": 0.0,
"count": 0.0,
"percent": 0.0,
"name": "Sunny"
},
{
"average": 0.0,
"count": 0.0,
"percent": 0.0,
"name": "Michael"
}
]
}
but the log as of the line Logger.info("body is #{inspect(body)}")
from above code dedups the data and returns below data instead
{
"avgPass": 85.55,
"avgFail": 14.45,
"totalStudents": 80.0,
"myScoreSchema": [
{
"average": 80.0,
"count": 8.0,
"percent": 80.0,
"name": "John"
},
{
"average": 0.0,
"count": 0.0,
"percent": 0.0,
"name": "Cena Sunny Michael"
}
]
}
Even though this is a smart feature but I don’t want this dedup feature. How to avoid the dedup.