open5e-api icon indicating copy to clipboard operation
open5e-api copied to clipboard

Adjust/regenerate Spells to include Classes as an array

Open eepMoody opened this issue 6 years ago • 7 comments

Currently this is only available as a string "wizard, druid, cleric". It'd be great if it was an array of strings instead. ["wizard", "druid", "cleric"] so that it can be better used for filtering, and parsed in cleverer ways on the frontend.

eepMoody avatar Aug 11 '18 16:08 eepMoody

Same goes for circles, archetypes, etc.

eepMoody avatar Aug 11 '18 16:08 eepMoody

Hey, I am looking for an issue to start off with. Mind guiding me on how I can start out on this one? Many thanks

McCrossin avatar May 27 '19 06:05 McCrossin

@eepMoody is this one you're looking to solve in the API layer? If so, we should transfer this issue to that project.

augustjohnson avatar May 27 '19 14:05 augustjohnson

Good point! I will go through and do so for all the API-related issues. They were made mostly when everything was one repo.

eepMoody avatar May 27 '19 19:05 eepMoody

Wondering if I could take it on, if it's still open, and which file is it located in.

Tasups avatar Apr 19 '23 16:04 Tasups

@Tasups This is still an issue, but I'm pretty close to solving it over in the API. If you're interested in contributing some python, I can definitely find something.

augustjohnson avatar Apr 19 '23 17:04 augustjohnson

See a big model upgrade here: https://github.com/open5e/open5e-api/tree/Spell-Model-Upgrade

The file you'd likely be adjusting if you were to take this on, would be https://github.com/open5e/open5e-api/blob/Spell-Model-Upgrade/api/models/spell.py

augustjohnson avatar Apr 19 '23 17:04 augustjohnson

Hi! I'm interested in taking this on. If I understand it correctly, we need a new ListField type of thing in models instead of a TextField, which is what we have now for all of classes, archetypes, circles, and so on. Is that correct? and then , dnd_class, archetype, and other fields can become a ListField type.

daydin avatar Apr 01 '24 02:04 daydin

Howdy @daydin thanks for showing the interest! So a few things have happened since this bug was originally logged. First: "spell_lists" have been included. See here: https://api-beta.open5e.com/v1/spells/magic-missile/ the spell_lists item includes (properly formated) ["sorcerer","wizard"] which is nice. Second, the API_V2 is starting to spin up. I'm working on a standardized implementation of spell sets over there, which will be online fairly soon, which will result is fixing this.

I am concerned that splitting this existing (dnd_class) field open would end up breaking frontend stuff, so I don't believe editing that is a good idea. At this point, I think this issue can probably be considered closed. Let me know if you have a thought.

augustjohnson avatar Apr 01 '24 15:04 augustjohnson

Totally, no worries!

daydin avatar Apr 01 '24 21:04 daydin

Both v1 and v2 spells have classes as an array. The initial concern of this issue has been addressed.

augustjohnson avatar Aug 08 '24 20:08 augustjohnson