Where possible, use built-in JSON instead of Jason

Note that it's not possible to replace any call where we encode and
pretty print, as JSON doesn't have such functionality.
This commit is contained in:
Claudio Ortolina
2024-12-19 20:18:09 +00:00
parent aaad2561ec
commit 9dce1cacb9
9 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ defmodule LastFm.ArtistTest do
api_response =
@api_response_path
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
|> Map.get("artist")
assert %LastFm.Artist{
+1 -1
View File
@@ -8,7 +8,7 @@ defmodule LastFm.TrackTest do
api_response =
@api_response_path
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
|> get_in(["recenttracks", "track"])
assert [
+1 -1
View File
@@ -4,6 +4,6 @@ defmodule LastFm.Fixtures do
def artist_get_info do
Path.join([@fixtures_folder, "artist.getinfo.json"])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
end
@@ -23,13 +23,13 @@ defmodule MusicLibrary.ReleaseGroupsFixtures do
def release_group(:mystery_of_time) do
Path.join([@fixtures_folder, "release_group - avantasia - the mystery of time.json"])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
def release_group(:marbles) do
Path.join([@fixtures_folder, "release_group - marillion - marbles.json"])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
def release_group(:lockdown_trilogy) do
@@ -38,19 +38,19 @@ defmodule MusicLibrary.ReleaseGroupsFixtures do
"release_group_with_includes - mariusz duda - lockdown trilogy.json"
])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
def release(:mystery_of_time) do
Path.join([@fixtures_folder, "release - avantasia - the mystery of time.json"])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
def release(:marbles) do
Path.join([@fixtures_folder, "release - marillion - marbles.json"])
|> File.read!()
|> Jason.decode!()
|> JSON.decode!()
end
def release_group_id(name) do