Observed Behaviour. When working with the /v2/items endpoint, ForeignKeys on the weapons field do not include the properties field (this is an array of weapon properies, ie. ['Versatile', 'Thrown'] etc.
Desired Behaviour. That the properties field be returned when the model is accessed via a ForeignKey on the /items endpoint
Description
Observed Behaviour. When working with the
/v2/items
endpoint, ForeignKeys on theweapons
field do not include theproperties
field (this is an array of weapon properies, ie. ['Versatile', 'Thrown'] etc.Desired Behaviour. That the
properties
field be returned when the model is accessed via a ForeignKey on the/items
endpointRecreation
First take a look at the
weapon
API V2 model. Observe that theproperties
property is already a part of this model: https://github.com/open5e/open5e-api/blob/730a66273f03737ef9ab9bbb9943089ea00b5521/api_v2/models/weapon.py#L136-L167Fork the
open5e-api
repo and checkout thestaging
branch. Setup and run test server.Visit the
/v2/items/srd_battleaxe/?depth=1&fields=name,key,weapon
(fields omitted for brevity)Notice that the
properties
field is not returned as a child of theweapon
field.