Skip to content

Add default level and components values when parsing#167

Merged
Carifio24 merged 3 commits into
masterfrom
spell-parse-updates
Apr 25, 2026
Merged

Add default level and components values when parsing#167
Carifio24 merged 3 commits into
masterfrom
spell-parse-updates

Conversation

@Carifio24

Copy link
Copy Markdown
Owner

This PR makes the spell parser slightly more permissive. Currently when constructing a spell from JSON, we require both the level and components fields. These changes allow these fields to be missing, and missing keys will be given default values:

  • Level: 0 (cantrip)
  • Components: [ ] (none required)

In general we should allow values to be missing, provided that there are reasonable defaults (for instance, we can't do this with the spell school).

@Carifio24 Carifio24 merged commit 774ef86 into master Apr 25, 2026
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.

1 participant