foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
202 stars 10 forks source link

Unsupported keys in package manifest files should generate a package warning that is surfaced to the developer. #8550

Closed gizmo2342 closed 4 weeks ago

gizmo2342 commented 1 year ago

User Experience

This is a followup to https://discord.com/channels/170995199584108546/930898124782829638/1042035412992008243

Although the main issue happened to be a typo (relationship instead of relationships), a check for unknown keys would have saved me (and possibly others) a lot of time.

aaclayton commented 1 year ago

I think we should perhaps generalize this for all DataModel instances by adding an option to the constructor that would raise warnings if encountering keys in the input data which are not supported by the schema. We could then use that option in the case of loading package manifests and add any generated warning messages to the array forwarded to the client.

gizmo2342 commented 1 year ago

I like that approach, even if it means that it is a v11 feature.

mkahvi commented 1 year ago

Like with a lot of developer oriented warnings, this kind of warning should not be shown to normal end users (in regards to manifests). It has no purpose for them and just increases warning noise for them about things they have zero need or ability to do anything about.

gizmo2342 commented 1 year ago

That's fine. It could be a CONFIG.debug flag (e.g. CONFIG.debug.strict) or even a runtime parameter (e.g. --strict).

aaclayton commented 2 months ago

A good restriction to put in place in time for V12 to encourage developers to update to best practices with these manifest files.

aaclayton commented 1 month ago

Shifting to HIGH priority to do before V12 stable.