Skip to content

Should We #[serde(deny_unknown_fields)]? #410

@zicklag

Description

@zicklag

I was wondering, does it make sense for us to deny unknown fields in our JSON assets?

It's a common source of confusion for me and I imagine other people when you get a typo in one of the field names and the game doesn't complain, so you think it worked, but in reality your new setting is being completely ignored.

I also found that the current JSON files have at least one particle_effect field in several files that isn't actually used in the struct anymore.

I'm not sure if we want to support older versions of files when possible, for backward compatibility, and allowing unknown fields helps that a little bit, but I think it would be better to do versioned asset files if we really wanted that.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions