open5e/open5e-api

Fix v2 key naming for conflicts across publishers / rulesets

Closed this issue · 4 comments

          I added a bit more, but I still don't have a great, clean answer for v2 for making PKs when there's conflicts.

Acolyte is a good example. There's one in wotc and one in a5e.

Prepending the publisher name is good, but in what hierarchy? Which publisher is best?
Prepending the ruleset might work, but could there be two "Obsidian Greatsword" items both in 5e?

I suppose I'd tend towards publisher if I had to choose. Maybe we could add a publisher shortname?

Any thoughts?

Originally posted by @augustjohnson in #394 (comment)

I think they could be separated into a generic id item-obsidian-greatsword and a unique id item-obsidian-greatsword-wotc-dndnext, where the generic id could refer to different items based on your ruleset and the unique id is used for permanent links.

the API could then pick items based on ruleset:
/items/item-obsidian-greatsword?ruleset=dndnext
would return the item
item-obsidian-greatsword-wotc-dndnext

and
/items/item-obsidian-greatsword?ruleset=a5e
item-obsidian-greatsword-wotc-dndnext
would return the item
item-obsidian-greatsword-levelup-a5e

wotc and dnd5e should proabably be the default if you don't supply anything, since these are usually seen as the baseline.

I think the relatively final naming convention on this will be:

{slugified name}-{document-shortname}.
for example:

magic-missile-srd
keen-intellect-a5esrd
caustic-blood-dmag

There are a few document shortnames that needs to be adjusted. "warlock" for example is pretty misleading.

I will take a crack at this fairly soon.

This would be resolved with #462

This has been resolved.