3. The Artist data source

🎯 Your goal for this step:

Add a new method to the class to retrieve artist-specific data

Artist data tasks

Use the following artist ID when completing these tasks.

An artist ID

Solution: The Artist data source

package com.example.soundtracks.models;
import com.example.soundtracks.generated.types.Artist;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.JsonNode;
@JsonIgnoreProperties(ignoreUnknown = true)
public class MappedArtist extends Artist {
public void mapFollowers(JsonNode followersNode) {
// ... other SpotifyClient methods
public MappedArtist artistRequest(String artistId) {
System.out.println("I am making a request to the artists endpoint for " + artistId);
return client
.uri("/artists/{artist_id}", artistId)

Share your questions and comments about this lesson

This course is currently in

. Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.