leonhard-s / auraxium

A high-level Python wrapper for the PlanetSide 2 API.
https://auraxium.readthedocs.io/
MIT License
28 stars 8 forks source link

Find endpoint for injecting hard-coded fallback data #31

Closed leonhard-s closed 3 years ago

leonhard-s commented 3 years ago

Several collections are incomplete, such as ps2/experience or ps2/loadout. It would be beneficial to have an endpoint as part of the object model that allows hard-coding certain dummy payloads to specific IDs.

For example, if a user attempts to retrieve a Loadout instance and a NotFoundError is raised, the API wrapper could consult its fallback table and return a dummy payload corresponding to the entries below:

loadout_id profile_id faction_id code_name
28 190 4 NSO Infiltrator
29 191 4 NSO Light Assault
30 192 4 NSO Medic
31 193 4 NSO Engineer
32 194 4 NSO Heavy Assault
45 252 4 NSO MAX

This would fix the error for the user despite the bad API data, but still allows falling back to the API data if it becomes available in the future.