diff --git a/cmd/schema.go b/cmd/schema.go index 97944e98b..c720fe453 100644 --- a/cmd/schema.go +++ b/cmd/schema.go @@ -6,8 +6,8 @@ import ( "os" "path/filepath" - "github.com/alecthomas/jsonschema" "github.com/goreleaser/goreleaser/pkg/config" + "github.com/invopop/jsonschema" "github.com/spf13/cobra" ) diff --git a/cmd/schema_test.go b/cmd/schema_test.go index dc35974ff..56fa6023f 100644 --- a/cmd/schema_test.go +++ b/cmd/schema_test.go @@ -21,5 +21,5 @@ func TestGenerateSchema(t *testing.T) { schema := map[string]interface{}{} require.NoError(t, json.NewDecoder(outFile).Decode(&schema)) - require.Equal(t, "http://json-schema.org/draft-04/schema#", schema["$schema"].(string)) + require.Equal(t, "http://json-schema.org/draft/2020-12/schema", schema["$schema"].(string)) } diff --git a/go.mod b/go.mod index 3638601ca..0871c6325 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( code.gitea.io/sdk/gitea v0.15.1 github.com/DisgoOrg/disgohook v1.4.4 github.com/Masterminds/semver/v3 v3.1.1 - github.com/alecthomas/jsonschema v0.0.0-20211209230136-e2b41affa5c1 github.com/apex/log v1.9.0 github.com/atc0005/go-teams-notify/v2 v2.6.1 github.com/caarlos0/ctrlc v1.0.0 @@ -23,6 +22,7 @@ require ( github.com/goreleaser/fileglob v1.3.0 github.com/goreleaser/nfpm/v2 v2.15.1 github.com/imdario/mergo v0.3.13 + github.com/invopop/jsonschema v0.4.0 github.com/jarcoal/httpmock v1.2.0 github.com/klauspost/pgzip v1.2.5 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index 2480810e3..ecce580a6 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,6 @@ github.com/ProtonMail/gopenpgp/v2 v2.2.2 h1:u2m7xt+CZWj88qK1UUNBoXeJCFJwJCZ/Ff4y github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/alecthomas/jsonschema v0.0.0-20211209230136-e2b41affa5c1 h1:6mZ7MG/flSahicBVy4GKlWI+dzoR5rgnm7H8e17TAio= -github.com/alecthomas/jsonschema v0.0.0-20211209230136-e2b41affa5c1/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= @@ -479,6 +477,8 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/invopop/jsonschema v0.4.0 h1:Yuy/unfgCnfV5Wl7H0HgFufp/rlurqPOOuacqyByrws= +github.com/invopop/jsonschema v0.4.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0= github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc= github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= diff --git a/pkg/config/config.go b/pkg/config/config.go index f75c9f1ca..59111ca7f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -10,11 +10,10 @@ import ( "strings" "time" - "github.com/alecthomas/jsonschema" - "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/yaml" "github.com/goreleaser/nfpm/v2/files" + "github.com/invopop/jsonschema" ) // GitHubURLs holds the URLs to be used when using github enterprise. @@ -108,17 +107,17 @@ func (a *HomebrewDependency) UnmarshalYAML(unmarshal func(interface{}) error) er return nil } -func (a HomebrewDependency) JSONSchemaType() *jsonschema.Type { +func (a HomebrewDependency) JSONSchema() *jsonschema.Schema { reflector := jsonschema.Reflector{ ExpandedStruct: true, } schema := reflector.Reflect(&homebrewDependency{}) - return &jsonschema.Type{ - OneOf: []*jsonschema.Type{ + return &jsonschema.Schema{ + OneOf: []*jsonschema.Schema{ { Type: "string", }, - schema.Type, + schema, }, } } @@ -264,13 +263,13 @@ func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (a StringArray) JSONSchemaType() *jsonschema.Type { - return &jsonschema.Type{ - OneOf: []*jsonschema.Type{{ +func (a StringArray) JSONSchema() *jsonschema.Schema { + return &jsonschema.Schema{ + OneOf: []*jsonschema.Schema{{ Type: "string", }, { Type: "array", - Items: &jsonschema.Type{ + Items: &jsonschema.Schema{ Type: "string", }, }}, @@ -295,13 +294,13 @@ func (a *FlagArray) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (a FlagArray) JSONSchemaType() *jsonschema.Type { - return &jsonschema.Type{ - OneOf: []*jsonschema.Type{{ +func (a FlagArray) JSONSchema() *jsonschema.Schema { + return &jsonschema.Schema{ + OneOf: []*jsonschema.Schema{{ Type: "string", }, { Type: "array", - Items: &jsonschema.Type{ + Items: &jsonschema.Schema{ Type: "string", }, }}, @@ -379,24 +378,6 @@ func (bhc *Hooks) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (bhc Hooks) JSONSchemaType() *jsonschema.Type { - type t Hooks - reflector := jsonschema.Reflector{ - ExpandedStruct: true, - } - schema := reflector.Reflect(&t{}) - return &jsonschema.Type{ - Items: &jsonschema.Type{ - OneOf: []*jsonschema.Type{ - { - Type: "string", - }, - schema.Type, - }, - }, - } -} - type Hook struct { Dir string `yaml:"dir,omitempty"` Cmd string `yaml:"cmd,omitempty"` @@ -421,18 +402,18 @@ func (bh *Hook) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (bh Hook) JSONSchemaType() *jsonschema.Type { +func (bh Hook) JSONSchema() *jsonschema.Schema { type t Hook reflector := jsonschema.Reflector{ ExpandedStruct: true, } schema := reflector.Reflect(&t{}) - return &jsonschema.Type{ - OneOf: []*jsonschema.Type{ + return &jsonschema.Schema{ + OneOf: []*jsonschema.Schema{ { Type: "string", }, - schema.Type, + schema, }, } } @@ -478,21 +459,21 @@ func (f *File) UnmarshalYAML(unmarshal func(interface{}) error) error { return nil } -func (f File) JSONSchemaType() *jsonschema.Type { +func (f File) JSONSchema() *jsonschema.Schema { type t File reflector := jsonschema.Reflector{ ExpandedStruct: true, } schema := reflector.Reflect(&t{}) // jsonschema would just refer to FileInfo in the definition. It doesn't get included there, as we override the - // generated schema with JSONSchemaType here. So we need to include it directly in the schema of File. + // generated schema with JSONSchema here. So we need to include it directly in the schema of File. schema.Properties.Set("info", reflector.Reflect(&FileInfo{}).Type) - return &jsonschema.Type{ - OneOf: []*jsonschema.Type{ + return &jsonschema.Schema{ + OneOf: []*jsonschema.Schema{ { Type: "string", }, - schema.Type, + schema, }, } } diff --git a/www/docs/static/schema.json b/www/docs/static/schema.json index f7a7823e8..6050c3221 100644 --- a/www/docs/static/schema.json +++ b/www/docs/static/schema.json @@ -1,8 +1,8 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Project", - "description": "goreleaser configuration definition file", - "definitions": { + "$schema": "http://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/goreleaser/goreleaser/pkg/config/project", + "$ref": "#/$defs/Project", + "$defs": { "AUR": { "properties": { "name": { @@ -15,7 +15,7 @@ "type": "array" }, "commit_author": { - "$ref": "#/definitions/CommitAuthor" + "$ref": "#/$defs/CommitAuthor" }, "commit_msg_template": { "type": "string" @@ -99,44 +99,34 @@ "type": "string" }, "twitter": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Twitter" + "$ref": "#/$defs/Twitter" }, "reddit": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Reddit" + "$ref": "#/$defs/Reddit" }, "slack": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Slack" + "$ref": "#/$defs/Slack" }, "discord": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Discord" + "$ref": "#/$defs/Discord" }, "teams": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Teams" + "$ref": "#/$defs/Teams" }, "smtp": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SMTP" + "$ref": "#/$defs/SMTP" }, "mattermost": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Mattermost" + "$ref": "#/$defs/Mattermost" }, "linkedin": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/LinkedIn" + "$ref": "#/$defs/LinkedIn" }, "telegram": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Telegram" + "$ref": "#/$defs/Telegram" }, "webhook": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Webhook" + "$ref": "#/$defs/Webhook" } }, "additionalProperties": false, @@ -169,8 +159,7 @@ }, "format_overrides": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/FormatOverride" + "$ref": "#/$defs/FormatOverride" }, "type": "array" }, @@ -186,8 +175,7 @@ }, "files": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/File" + "$ref": "#/$defs/File" }, "type": "array" }, @@ -244,7 +232,7 @@ }, "extra_files": { "items": { - "$ref": "#/definitions/ExtraFile" + "$ref": "#/$defs/ExtraFile" }, "type": "array" } @@ -295,8 +283,7 @@ }, "ignore": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/IgnoredBuild" + "$ref": "#/$defs/IgnoredBuild" }, "type": "array" }, @@ -310,8 +297,7 @@ "type": "string" }, "hooks": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/BuildHookConfig" + "$ref": "#/$defs/BuildHookConfig" }, "env": { "items": { @@ -341,74 +327,23 @@ "type": "boolean" }, "ldflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" }, "tags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/FlagArray" }, "flags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/FlagArray" }, "asmflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" }, "gcflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" }, "overrides": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/BuildDetailsOverride" + "$ref": "#/$defs/BuildDetailsOverride" }, "type": "array" } @@ -434,69 +369,19 @@ "type": "string" }, "ldflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" }, "tags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/FlagArray" }, "flags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/FlagArray" }, "asmflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" }, "gcflags": { - "oneOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - } - ] + "$ref": "#/$defs/StringArray" } }, "additionalProperties": false, @@ -506,33 +391,15 @@ "properties": { "pre": { "items": { - "oneOf": [ - { - "type": "string" - }, - { - "$schema": "http://json-schema.org/draft-04/schema#", - "properties": {}, - "additionalProperties": false, - "type": "object" - } - ] - } + "$ref": "#/$defs/Hook" + }, + "type": "array" }, "post": { "items": { - "oneOf": [ - { - "type": "string" - }, - { - "$schema": "http://json-schema.org/draft-04/schema#", - "properties": {}, - "additionalProperties": false, - "type": "object" - } - ] - } + "$ref": "#/$defs/Hook" + }, + "type": "array" } }, "additionalProperties": false, @@ -556,8 +423,7 @@ "Changelog": { "properties": { "filters": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Filters" + "$ref": "#/$defs/Filters" }, "sort": { "type": "string" @@ -566,19 +432,18 @@ "type": "boolean" }, "use": { + "type": "string", "enum": [ "git", "github", "github-native", "gitlab" ], - "type": "string", "default": "git" }, "groups": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ChangeLogGroup" + "$ref": "#/$defs/ChangeLogGroup" }, "type": "array" } @@ -605,7 +470,7 @@ }, "extra_files": { "items": { - "$ref": "#/definitions/ExtraFile" + "$ref": "#/$defs/ExtraFile" }, "type": "array" } @@ -640,17 +505,13 @@ "type": "string" }, "file_info": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ContentFileInfo" + "$ref": "#/$defs/ContentFileInfo" } }, "additionalProperties": false, "type": "object" }, "ContentFileInfo": { - "required": [ - "group" - ], "properties": { "owner": { "type": "string" @@ -667,7 +528,10 @@ } }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "group" + ] }, "Discord": { "properties": { @@ -819,19 +683,10 @@ "type": "string" }, { - "$schema": "http://json-schema.org/draft-04/schema#", - "properties": { - "src": { - "type": "string" - }, - "dst": { - "type": "string" - }, - "strip_parent": { - "type": "boolean" - }, - "info": { - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/goreleaser/goreleaser/pkg/config/t", + "$defs": { + "FileInfo": { "properties": { "owner": { "type": "string" @@ -851,6 +706,18 @@ "type": "object" } }, + "properties": { + "src": { + "type": "string" + }, + "dst": { + "type": "string" + }, + "strip_parent": { + "type": "boolean" + }, + "info": "object" + }, "additionalProperties": false, "type": "object" } @@ -868,6 +735,19 @@ "additionalProperties": false, "type": "object" }, + "FlagArray": { + "oneOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, "FormatOverride": { "properties": { "goos": { @@ -937,10 +817,10 @@ "type": "string" }, "rig": { - "$ref": "#/definitions/RepoRef" + "$ref": "#/$defs/RepoRef" }, "commit_author": { - "$ref": "#/definitions/CommitAuthor" + "$ref": "#/$defs/CommitAuthor" }, "commit_msg_template": { "type": "string" @@ -1000,12 +880,10 @@ "type": "string" }, "tap": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/RepoRef" + "$ref": "#/$defs/RepoRef" }, "commit_author": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/CommitAuthor" + "$ref": "#/$defs/CommitAuthor" }, "commit_msg_template": { "type": "string" @@ -1027,8 +905,7 @@ }, "dependencies": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/HomebrewDependency" + "$ref": "#/$defs/HomebrewDependency" }, "type": "array" }, @@ -1090,7 +967,8 @@ "type": "string" }, { - "$schema": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/goreleaser/goreleaser/pkg/config/homebrew-dependency", "properties": { "name": { "type": "string" @@ -1104,6 +982,36 @@ } ] }, + "Hook": { + "oneOf": [ + { + "type": "string" + }, + { + "$schema": "http://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/goreleaser/goreleaser/pkg/config/t", + "properties": { + "dir": { + "type": "string" + }, + "cmd": { + "type": "string" + }, + "env": { + "items": { + "type": "string" + }, + "type": "array" + }, + "output": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + } + ] + }, "IgnoredBuild": { "properties": { "goos": { @@ -1137,10 +1045,10 @@ "type": "string" }, "index": { - "$ref": "#/definitions/RepoRef" + "$ref": "#/$defs/RepoRef" }, "commit_author": { - "$ref": "#/definitions/CommitAuthor" + "$ref": "#/$defs/CommitAuthor" }, "commit_msg_template": { "type": "string" @@ -1218,7 +1126,7 @@ "Milestone": { "properties": { "repo": { - "$ref": "#/definitions/Repo" + "$ref": "#/$defs/Repo" }, "close": { "type": "boolean" @@ -1299,32 +1207,26 @@ }, "contents": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Content" + "$ref": "#/$defs/Content" }, "type": "array" }, "scripts": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMScripts" + "$ref": "#/$defs/NFPMScripts" }, "rpm": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMRPM" + "$ref": "#/$defs/NFPMRPM" }, "deb": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMDeb" + "$ref": "#/$defs/NFPMDeb" }, "apk": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMAPK" + "$ref": "#/$defs/NFPMAPK" }, "overrides": { "patternProperties": { ".*": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMOverridables" + "$ref": "#/$defs/NFPMOverridables" } }, "type": "object" @@ -1378,12 +1280,10 @@ "NFPMAPK": { "properties": { "scripts": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMAPKScripts" + "$ref": "#/$defs/NFPMAPKScripts" }, "signature": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMAPKSignature" + "$ref": "#/$defs/NFPMAPKSignature" } }, "additionalProperties": false, @@ -1416,12 +1316,10 @@ "NFPMDeb": { "properties": { "scripts": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMDebScripts" + "$ref": "#/$defs/NFPMDebScripts" }, "triggers": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMDebTriggers" + "$ref": "#/$defs/NFPMDebTriggers" }, "breaks": { "items": { @@ -1430,8 +1328,7 @@ "type": "array" }, "signature": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMDebSignature" + "$ref": "#/$defs/NFPMDebSignature" }, "lintian_overrides": { "items": { @@ -1575,21 +1472,21 @@ }, "contents": { "items": { - "$ref": "#/definitions/Content" + "$ref": "#/$defs/Content" }, "type": "array" }, "scripts": { - "$ref": "#/definitions/NFPMScripts" + "$ref": "#/$defs/NFPMScripts" }, "rpm": { - "$ref": "#/definitions/NFPMRPM" + "$ref": "#/$defs/NFPMRPM" }, "deb": { - "$ref": "#/definitions/NFPMDeb" + "$ref": "#/$defs/NFPMDeb" }, "apk": { - "$ref": "#/definitions/NFPMAPK" + "$ref": "#/$defs/NFPMAPK" } }, "additionalProperties": false, @@ -1607,12 +1504,10 @@ "type": "string" }, "signature": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMRPMSignature" + "$ref": "#/$defs/NFPMRPMSignature" }, "scripts": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPMRPMScripts" + "$ref": "#/$defs/NFPMRPMScripts" } }, "additionalProperties": false, @@ -1669,193 +1564,163 @@ "type": "array" }, "release": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Release" + "$ref": "#/$defs/Release" }, "milestones": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Milestone" + "$ref": "#/$defs/Milestone" }, "type": "array" }, "brews": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Homebrew" + "$ref": "#/$defs/Homebrew" }, "type": "array" }, "rigs": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GoFish" + "$ref": "#/$defs/GoFish" }, "type": "array" }, "aurs": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/AUR" + "$ref": "#/$defs/AUR" }, "type": "array" }, "krews": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Krew" + "$ref": "#/$defs/Krew" }, "type": "array" }, "scoop": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Scoop" + "$ref": "#/$defs/Scoop" }, "builds": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Build" + "$ref": "#/$defs/Build" }, "type": "array" }, "archives": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Archive" + "$ref": "#/$defs/Archive" }, "type": "array" }, "nfpms": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/NFPM" + "$ref": "#/$defs/NFPM" }, "type": "array" }, "snapcrafts": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Snapcraft" + "$ref": "#/$defs/Snapcraft" }, "type": "array" }, "snapshot": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Snapshot" + "$ref": "#/$defs/Snapshot" }, "checksum": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Checksum" + "$ref": "#/$defs/Checksum" }, "dockers": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Docker" + "$ref": "#/$defs/Docker" }, "type": "array" }, "docker_manifests": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/DockerManifest" + "$ref": "#/$defs/DockerManifest" }, "type": "array" }, "artifactories": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Upload" + "$ref": "#/$defs/Upload" }, "type": "array" }, "uploads": { "items": { - "$ref": "#/definitions/Upload" + "$ref": "#/$defs/Upload" }, "type": "array" }, "blobs": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Blob" + "$ref": "#/$defs/Blob" }, "type": "array" }, "publishers": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Publisher" + "$ref": "#/$defs/Publisher" }, "type": "array" }, "changelog": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Changelog" + "$ref": "#/$defs/Changelog" }, "dist": { "type": "string" }, "signs": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Sign" + "$ref": "#/$defs/Sign" }, "type": "array" }, "docker_signs": { "items": { - "$ref": "#/definitions/Sign" + "$ref": "#/$defs/Sign" }, "type": "array" }, "env_files": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/EnvFiles" + "$ref": "#/$defs/EnvFiles" }, "before": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Before" + "$ref": "#/$defs/Before" }, "source": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Source" + "$ref": "#/$defs/Source" }, "gomod": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GoMod" + "$ref": "#/$defs/GoMod" }, "announce": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Announce" + "$ref": "#/$defs/Announce" }, "sboms": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SBOM" + "$ref": "#/$defs/SBOM" }, "type": "array" }, "universal_binaries": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/UniversalBinary" + "$ref": "#/$defs/UniversalBinary" }, "type": "array" }, "build": { - "$ref": "#/definitions/Build" + "$ref": "#/$defs/Build" }, "github_urls": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GitHubURLs" + "$ref": "#/$defs/GitHubURLs" }, "gitlab_urls": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GitLabURLs" + "$ref": "#/$defs/GitLabURLs" }, "gitea_urls": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/GiteaURLs" + "$ref": "#/$defs/GiteaURLs" } }, "additionalProperties": false, @@ -1892,7 +1757,7 @@ }, "extra_files": { "items": { - "$ref": "#/definitions/ExtraFile" + "$ref": "#/$defs/ExtraFile" }, "type": "array" } @@ -1927,14 +1792,13 @@ "Release": { "properties": { "github": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/Repo" + "$ref": "#/$defs/Repo" }, "gitlab": { - "$ref": "#/definitions/Repo" + "$ref": "#/$defs/Repo" }, "gitea": { - "$ref": "#/definitions/Repo" + "$ref": "#/$defs/Repo" }, "draft": { "type": "boolean" @@ -1956,8 +1820,7 @@ }, "extra_files": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/ExtraFile" + "$ref": "#/$defs/ExtraFile" }, "type": "array" }, @@ -1971,13 +1834,13 @@ "type": "string" }, "mode": { + "type": "string", "enum": [ "keep-existing", "append", "prepend", "replace" ], - "type": "string", "default": "keep-existing" } }, @@ -2095,13 +1958,13 @@ "type": "string" }, "bucket": { - "$ref": "#/definitions/RepoRef" + "$ref": "#/$defs/RepoRef" }, "folder": { "type": "string" }, "commit_author": { - "$ref": "#/definitions/CommitAuthor" + "$ref": "#/$defs/CommitAuthor" }, "commit_msg_template": { "type": "string" @@ -2216,15 +2079,13 @@ }, "blocks": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SlackBlock" + "$ref": "#/$defs/SlackBlock" }, "type": "array" }, "attachments": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SlackAttachment" + "$ref": "#/$defs/SlackAttachment" }, "type": "array" } @@ -2233,28 +2094,24 @@ "type": "object" }, "SlackAttachment": { - "required": [ - "Internal" - ], "properties": { - "Internal": { - "additionalProperties": true - } + "Internal": true }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "Internal" + ] }, "SlackBlock": { - "required": [ - "Internal" - ], "properties": { - "Internal": { - "additionalProperties": true - } + "Internal": true }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "Internal" + ] }, "Snapcraft": { "properties": { @@ -2311,8 +2168,7 @@ "layout": { "patternProperties": { ".*": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SnapcraftLayoutMetadata" + "$ref": "#/$defs/SnapcraftLayoutMetadata" } }, "type": "object" @@ -2320,24 +2176,17 @@ "apps": { "patternProperties": { ".*": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SnapcraftAppMetadata" + "$ref": "#/$defs/SnapcraftAppMetadata" } }, "type": "object" }, "plugs": { - "patternProperties": { - ".*": { - "additionalProperties": true - } - }, "type": "object" }, "extra_files": { "items": { - "$schema": "http://json-schema.org/draft-04/schema#", - "$ref": "#/definitions/SnapcraftExtraFiles" + "$ref": "#/$defs/SnapcraftExtraFiles" }, "type": "array" } @@ -2346,9 +2195,6 @@ "type": "object" }, "SnapcraftAppMetadata": { - "required": [ - "command" - ], "properties": { "command": { "type": "string" @@ -2402,11 +2248,6 @@ "type": "string" }, "environment": { - "patternProperties": { - ".*": { - "additionalProperties": true - } - }, "type": "object" }, "extensions": { @@ -2419,11 +2260,6 @@ "type": "string" }, "passthrough": { - "patternProperties": { - ".*": { - "additionalProperties": true - } - }, "type": "object" }, "plugs": { @@ -2454,11 +2290,6 @@ "type": "array" }, "sockets": { - "patternProperties": { - ".*": { - "additionalProperties": true - } - }, "type": "object" }, "start_timeout": { @@ -2481,12 +2312,12 @@ } }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "command" + ] }, "SnapcraftExtraFiles": { - "required": [ - "source" - ], "properties": { "source": { "type": "string" @@ -2499,7 +2330,10 @@ } }, "additionalProperties": false, - "type": "object" + "type": "object", + "required": [ + "source" + ] }, "SnapcraftLayoutMetadata": { "properties": { @@ -2546,6 +2380,19 @@ "additionalProperties": false, "type": "object" }, + "StringArray": { + "oneOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, "Teams": { "properties": { "enabled": { @@ -2612,7 +2459,7 @@ "type": "boolean" }, "hooks": { - "$ref": "#/definitions/BuildHookConfig" + "$ref": "#/$defs/BuildHookConfig" } }, "additionalProperties": false, @@ -2703,5 +2550,6 @@ "additionalProperties": false, "type": "object" } - } + }, + "description": "goreleaser configuration definition file" } \ No newline at end of file