Skip to content

[BUG] Magic Items with a null rarity field are flagged as non-magic #817

@calumbell

Description

@calumbell

Bug description

Magic items in the Open5e dataset whose "rarity" is null are flagged as non-magical, with the "is_magic_item" field returning false.

Looking at where this property is defined Item model, it is clear to see why:

@property 
@extend_schema_field(OpenApiTypes.BOOL)
def is_magic_item(self):
  return self.rarity is not None

The items where are noticed this were the srd-2024 Belt of Giant Strength and Feather Token, which are better described as having various rarities (each contains a table of different variations of the item at different rarities).

Looking at the search results for "belt of giant strength", it seems that the way this was handled for the srd-2014 Belt of GIant Strength was to break out each variation into its own item, doing the same to the srd-2024 version would maintain consistancy. However, this feels like an API bug that would better serve future-us to resolve instead of coding around it.

Steps to Reproduce

The bug is clearly visible on the current version of the Open5e beta API deployment on the following pages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions