Skip to content

Commit

Permalink
docs: update JSON Schema (#2653)
Browse files Browse the repository at this point in the history
* docs: update JSON Schema

* docs: update JSON Schema

* style: sort fields
  • Loading branch information
suzuki-shunsuke authored Feb 1, 2024
1 parent 3ae7988 commit 251690f
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 86 deletions.
167 changes: 84 additions & 83 deletions json-schema/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
},
"Build": {
"properties": {
"enabled": {
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
Expand All @@ -35,9 +38,6 @@
},
"excluded_envs": {
"$ref": "#/$defs/SupportedEnvs"
},
"enabled": {
"type": "boolean"
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -286,6 +286,7 @@
"http",
"go",
"go_install",
"cargo",
"go_build"
]
},
Expand All @@ -303,15 +304,6 @@
"crate": {
"type": "string"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"url": {
"type": "string"
},
Expand All @@ -324,6 +316,18 @@
"windows_ext": {
"type": "string"
},
"append_ext": {
"type": "boolean"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"replacements": {
"$ref": "#/$defs/Replacements"
},
Expand All @@ -336,9 +340,6 @@
"slsa_provenance": {
"$ref": "#/$defs/SLSAProvenance"
},
"append_ext": {
"type": "boolean"
},
"envs": {
"$ref": "#/$defs/SupportedEnvs"
}
Expand Down Expand Up @@ -400,9 +401,6 @@
"crate": {
"type": "string"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"url": {
"type": "string"
},
Expand All @@ -418,30 +416,6 @@
"dmg"
]
},
"overrides": {
"items": {
"$ref": "#/$defs/Override"
},
"type": "array"
},
"format_overrides": {
"items": {
"$ref": "#/$defs/FormatOverride"
},
"type": "array"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"replacements": {
"$ref": "#/$defs/Replacements"
},
"supported_envs": {
"$ref": "#/$defs/SupportedEnvs"
},
"version_filter": {
"type": "string"
},
Expand Down Expand Up @@ -469,6 +443,42 @@
"windows_ext": {
"type": "string"
},
"private": {
"type": "boolean"
},
"append_ext": {
"type": "boolean"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"build": {
"$ref": "#/$defs/Build"
},
"overrides": {
"items": {
"$ref": "#/$defs/Override"
},
"type": "array"
},
"format_overrides": {
"items": {
"$ref": "#/$defs/FormatOverride"
},
"type": "array"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"replacements": {
"$ref": "#/$defs/Replacements"
},
"supported_envs": {
"$ref": "#/$defs/SupportedEnvs"
},
"checksum": {
"$ref": "#/$defs/Checksum"
},
Expand All @@ -478,15 +488,6 @@
"slsa_provenance": {
"$ref": "#/$defs/SLSAProvenance"
},
"private": {
"type": "boolean"
},
"build": {
"$ref": "#/$defs/Build"
},
"append_ext": {
"type": "boolean"
},
"version_constraint": {
"type": "string"
},
Expand Down Expand Up @@ -610,21 +611,12 @@
"crate": {
"type": "string"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"path": {
"type": "string"
},
"url": {
"type": "string"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"format": {
"type": "string",
"examples": [
Expand All @@ -633,18 +625,6 @@
"zip"
]
},
"format_overrides": {
"$ref": "#/$defs/FormatOverrides"
},
"overrides": {
"$ref": "#/$defs/Overrides"
},
"replacements": {
"$ref": "#/$defs/Replacements"
},
"supported_envs": {
"$ref": "#/$defs/SupportedEnvs"
},
"version_filter": {
"type": "string"
},
Expand All @@ -654,6 +634,12 @@
"version_source": {
"type": "string"
},
"windows_ext": {
"type": "string"
},
"error_message": {
"type": "string"
},
"rosetta2": {
"type": "boolean"
},
Expand All @@ -663,8 +649,26 @@
"complete_windows_ext": {
"type": "boolean"
},
"windows_ext": {
"type": "string"
"no_asset": {
"type": "boolean"
},
"append_ext": {
"type": "boolean"
},
"cargo": {
"$ref": "#/$defs/Cargo"
},
"files": {
"items": {
"$ref": "#/$defs/File"
},
"type": "array"
},
"format_overrides": {
"$ref": "#/$defs/FormatOverrides"
},
"replacements": {
"$ref": "#/$defs/Replacements"
},
"checksum": {
"$ref": "#/$defs/Checksum"
Expand All @@ -675,17 +679,14 @@
"slsa_provenance": {
"$ref": "#/$defs/SLSAProvenance"
},
"error_message": {
"type": "string"
},
"no_asset": {
"type": "boolean"
},
"append_ext": {
"type": "boolean"
},
"build": {
"$ref": "#/$defs/Build"
},
"overrides": {
"$ref": "#/$defs/Overrides"
},
"supported_envs": {
"$ref": "#/$defs/SupportedEnvs"
}
},
"additionalProperties": false,
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/registry/package_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ type VersionOverride struct {
Cargo *Cargo `json:"cargo,omitempty"`
Files []*File `yaml:",omitempty" json:"files,omitempty"`
FormatOverrides FormatOverrides `yaml:"format_overrides,omitempty" json:"format_overrides,omitempty"`
Overrides Overrides `yaml:",omitempty" json:"overrides,omitempty"`
Replacements Replacements `yaml:",omitempty" json:"replacements,omitempty"`
SupportedEnvs SupportedEnvs `yaml:"supported_envs,omitempty" json:"supported_envs,omitempty"`
Checksum *Checksum `json:"checksum,omitempty"`
Cosign *Cosign `json:"cosign,omitempty"`
SLSAProvenance *SLSAProvenance `json:"slsa_provenance,omitempty" yaml:"slsa_provenance,omitempty"`
Build *Build `json:"build,omitempty" yaml:",omitempty"`
Overrides Overrides `yaml:",omitempty" json:"overrides,omitempty"`
SupportedEnvs SupportedEnvs `yaml:"supported_envs,omitempty" json:"supported_envs,omitempty"`
}

type Override struct {
GOOS string `yaml:",omitempty" json:"goos,omitempty" jsonschema:"enum=aix,enum=android,enum=darwin,enum=dragonfly,enum=freebsd,enum=illumos,enum=ios,enum=linux,enum=netbsd,enum=openbsd,enum=plan9,enum=solaris,enum=windows"`
GOArch string `yaml:",omitempty" json:"goarch,omitempty" jsonschema:"enum=386,enum=amd64,enum=arm,enum=arm64,enum=mips,enum=mips64,enum=mips64le,enum=mipsle,enum=ppc64,enum=ppc64le,enum=riscv64,enum=s390x"`
Type string `json:"type,omitempty" jsonschema:"enum=github_release,enum=github_content,enum=github_archive,enum=http,enum=go,enum=go_install,enum=go_build"`
Type string `json:"type,omitempty" jsonschema:"enum=github_release,enum=github_content,enum=github_archive,enum=http,enum=go,enum=go_install,enum=cargo,enum=go_build"`
Format string `yaml:",omitempty" json:"format,omitempty" jsonschema:"example=tar.gz,example=raw,example=zip"`
Asset string `yaml:",omitempty" json:"asset,omitempty"`
Crate string `json:"crate,omitempty" yaml:",omitempty"`
Expand Down

0 comments on commit 251690f

Please sign in to comment.