Add strict custom field registry

This commit is contained in:
2026-05-07 11:04:11 +08:00
parent 27e71d8c51
commit c1cc9132a4
20 changed files with 582 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ func (p *Project) Validate(stage string) Report {
report.addError("unsupported_gsp_version", "", p.Manifest.File, fmt.Sprintf("GSP version %q is not supported by this toolkit", p.Manifest.GSPVersion))
}
}
p.validateFieldRegistry(&report)
for _, unit := range p.Units {
if unit.ID == "" {
report.addError("missing_id", "", unit.File, "GSP requires id")
@@ -66,6 +67,7 @@ func (p *Project) Validate(stage string) Report {
if unit.Context == "" {
report.addNotice("placeholder", unit.ID, unit.File, "GSP has no context and is treated as placeholder")
}
p.validateCustomFields(&report, unit)
}
for id, units := range p.Duplicates {
files := make([]string, 0, len(units))