refactor(api): align settings and gameplay source metadata - #259
Conversation
Teakowa
left a comment
There was a problem hiding this comment.
crates/workshop-rs/src/gameplay/data.rs / gameplay.json: the required wire field changed from evidence to sources, but the gameplay schema is still version 1. This makes two incompatible JSON shapes claim the same schema version. It also exposes a loader bug: load() fully deserializes GameplayFile before checking schema_version, so a real old v1 payload now fails as Malformed(missing field sources) instead of UnsupportedSchema(1).
Please version this wire-format change (e.g. v2) and make the schema-version check happen before deserializing version-specific hero records (or otherwise preserve explicit old-schema rejection). Update the embedded schema/digest/docs and add a regression using an actual v1-shaped payload, not only current JSON with the version integer changed.
|
Addressed in
Validation passed locally: |
Summary
SettingSource,SettingSourceKind,SourceReference,sources(),MissingSource, andSourceUnavailable.sourcesschema.Verification
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --all-targetscargo run -p workshop-rs --bin workshop-catalog-gen -- checkgit diff --checksourcesback toevidencemakes the loader test fail with missingsources.cargo semver-checks check-release --package workshop-rsreports the intentional public renames against the current0.4.4baseline. This is the pre-1.0 contract change covered by parent issue #252; the compatibility gate should be evaluated against the corresponding1.0.0release baseline.The downstream
opy-rssettings test still references the pre-changeSettingDefinition::provenance()API and should be updated when the owner revision is pinned after this change merges.Fixes #254