Skip to content

Conversation

@calumbell
Copy link
Contributor

This PR closes #627 by implementing the following changes to the ClassFeatureItem model:

  1. Renaming the featureitems field to gained_at, to better describe that this is an array of levels at which a given feature is gained.

  2. Adding an additional field to each object returned by the gained_at array called detail which is used to add additional contextual information about how the same feature gained at different levels differs.

Additional work was undertaken to add "detail"s to applicable ClassFeatureItems belonging to the SRD Fighter (V2) data. This was done for testing purposes.

Following these changes, the API now returns this data in a new way that is much easier to parse:

{
  "key": "srd_fighter_action-surge",
  "name: "Action Surge",
  "gained_at": [
    {
      "level": 2,
      "detail": "one use",
    },
    {
      "level": 17,
      "detail": "two uses",
    },
  ],
}

@calumbell calumbell merged commit a6ad598 into open5e:staging Mar 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update featureitems field of ClassFeature model

2 participants