Discogs.Services.JSONSanitize (discogs_shuffle v0.2.1) View Source

Massages Discogs JSON properties into attribute maps ready for use by Ecto changesets.

Link to this section Summary

Types

%Discogs.Release{} changeset attributes

Discogs JSON API release payload properties

Functions

Extracts the relevant attributes from Discogs Release JSON needed create an Ecto changeset with valid properties and associations.

Link to this section Types

Specs

release_attrs() :: %{optional(any()) => any()}

%Discogs.Release{} changeset attributes

Specs

release_json() :: %{optional(any()) => any()}

Discogs JSON API release payload properties

Link to this section Functions

Link to this function

get_release_params(releases_json)

View Source

Specs

get_release_params([release_json()]) :: [release_attrs()]

Extracts the relevant attributes from Discogs Release JSON needed create an Ecto changeset with valid properties and associations.

Includes support for associations:

Note that this only returns the attributes - not the %Release{} structs themselves.