Closed BeMacized closed 7 years ago
CardAPI.getAllCards() can throw an error when using filters and the results span multiple "pages", due to incorrect parsing of the "page" parameter.
Parsing the URL correctly fixes this issue.
This issue is reproducible as follows:
import io.magicthegathering.javasdk.api.CardAPI; import io.magicthegathering.javasdk.resource.Card; import java.util.ArrayList; import java.util.List; public class Test { public static void main(String[] args) { List<String> filters = new ArrayList<>(); filters.add("types=artifact,creature"); List<Card> cards = CardAPI.getAllCards(filters); System.out.println(String.format("Found %s cards", cards.size())); } }
CardAPI.getAllCards() can throw an error when using filters and the results span multiple "pages", due to incorrect parsing of the "page" parameter.
Parsing the URL correctly fixes this issue.
This issue is reproducible as follows: