From a85d049f9b6b376c9ebfb729ea086e499efdcee6 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 21 Dec 2023 09:16:17 -0300 Subject: [PATCH] fix(winget): improve schema (#4489) make required fields required Signed-off-by: Carlos Alexandro Becker --- pkg/config/config.go | 10 +++++----- www/docs/static/schema.json | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 6fe5c4541b8..a34ca28794d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -318,25 +318,25 @@ func (a *NixDependency) UnmarshalYAML(unmarshal func(interface{}) error) error { type Winget struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` - PackageIdentifier string `yaml:"package_identifier,omitempty" json:"package_identifier,omitempty"` - Publisher string `yaml:"publisher,omitempty" json:"publisher,omitempty"` + PackageIdentifier string `yaml:"package_identifier" json:"package_identifier"` + Publisher string `yaml:"publisher" json:"publisher"` PublisherURL string `yaml:"publisher_url,omitempty" json:"publisher_url,omitempty"` PublisherSupportURL string `yaml:"publisher_support_url,omitempty" json:"publisher_support_url,omitempty"` Copyright string `yaml:"copyright,omitempty" json:"copyright,omitempty"` CopyrightURL string `yaml:"copyright_url,omitempty" json:"copyright_url,omitempty"` Author string `yaml:"author,omitempty" json:"author,omitempty"` Path string `yaml:"path,omitempty" json:"path,omitempty"` - Repository RepoRef `yaml:"repository,omitempty" json:"repository,omitempty"` + Repository RepoRef `yaml:"repository" json:"repository"` CommitAuthor CommitAuthor `yaml:"commit_author,omitempty" json:"commit_author,omitempty"` CommitMessageTemplate string `yaml:"commit_msg_template,omitempty" json:"commit_msg_template,omitempty"` IDs []string `yaml:"ids,omitempty" json:"ids,omitempty"` Goamd64 string `yaml:"goamd64,omitempty" json:"goamd64,omitempty"` SkipUpload string `yaml:"skip_upload,omitempty" json:"skip_upload,omitempty" jsonschema:"oneof_type=string;boolean"` URLTemplate string `yaml:"url_template,omitempty" json:"url_template,omitempty"` - ShortDescription string `yaml:"short_description,omitempty" json:"short_description,omitempty"` + ShortDescription string `yaml:"short_description" json:"short_description"` Description string `yaml:"description,omitempty" json:"description,omitempty"` Homepage string `yaml:"homepage,omitempty" json:"homepage,omitempty"` - License string `yaml:"license,omitempty" json:"license,omitempty"` + License string `yaml:"license" json:"license"` LicenseURL string `yaml:"license_url,omitempty" json:"license_url,omitempty"` ReleaseNotes string `yaml:"release_notes,omitempty" json:"release_notes,omitempty"` ReleaseNotesURL string `yaml:"release_notes_url,omitempty" json:"release_notes_url,omitempty"` diff --git a/www/docs/static/schema.json b/www/docs/static/schema.json index 1e5710290b8..87f5131b40d 100644 --- a/www/docs/static/schema.json +++ b/www/docs/static/schema.json @@ -101,6 +101,9 @@ }, "goamd64": { "type": "string" + }, + "directory": { + "type": "string" } }, "additionalProperties": false, @@ -3554,7 +3557,14 @@ } }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "package_identifier", + "publisher", + "repository", + "short_description", + "license" + ] }, "WingetDependency": { "properties": {