-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Based on pgxn/rfcs#3. As with the v1 schemas, use JSON Schema v2020 for the v2 schemas. Fix a few minor issues with the v1 schema, as well. Add full test suite in Rust; move code shared between the v1 and v2 tests to `tests/common/mod.rs`. This includes custom format functions not required for v1, including spdx version expression validation with the `spdx` crate, and path validation to ensure no `..` is included in paths.
- Loading branch information
Showing
48 changed files
with
5,037 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ serde_json = "1.0" | |
|
||
[dependencies] | ||
serde = { version = "1", features = ["derive"] } | ||
spdx = "0.10.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"type": "string", | ||
"minLength": 1 | ||
}, | ||
"uniqueItems": true, | ||
"minItems": 1 | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://pgxn.org/meta/v2/app.schema.json", | ||
"title": "App", | ||
"description": "An App represents an applications, command-line or otherwise.", | ||
"type": "object", | ||
"properties": { | ||
"lang": { | ||
"$ref": "term.schema.json", | ||
"description": "A short string representing the implementation language. Required for apps that need the `'#!{cmd}` shebang line modified before installing." | ||
}, | ||
"bin": { | ||
"$ref": "path.schema.json", | ||
"description": "A path pointing to the app binary, which may be generated by the build process." | ||
}, | ||
"doc": { | ||
"$ref": "path.schema.json", | ||
"description": "A path pointing to the documentation file for the app, which **SHOULD** be more than a README." | ||
}, | ||
"abstract": { | ||
"type": "string", | ||
"description": "A short String value describing the extension.", | ||
"minLength": 1 | ||
}, | ||
"lib": { | ||
"$ref": "path.schema.json", | ||
"description": "A path pointing a directory of additional files to install, such as support libraries or modules." | ||
}, | ||
"man": { | ||
"$ref": "path.schema.json", | ||
"description": "A path pointing to a man page or directory of man pages created by the build process." | ||
}, | ||
"html": { | ||
"$ref": "path.schema.json", | ||
"description": "A path pointing to an HTML file or directory of HTML files created by the build process." | ||
} | ||
}, | ||
"required": ["bin"], | ||
"patternProperties": { "^[xX]_.": { "description": "Custom key" } }, | ||
"additionalProperties": false, | ||
"examples": [ | ||
{ | ||
"lang": "perl", | ||
"bin": "blib/script/app", | ||
"lib": "blib/lib", | ||
"man": "blib/libdoc", | ||
"html": "blib/libhtml", | ||
"doc": "doc/app.md", | ||
"abstract": "blah blah blah" | ||
}, | ||
{ | ||
"lang": "python", | ||
"bin": "bin/common/check_unique_constraint.py", | ||
"abstract": "Check that all rows in a partition set are unique for the given columns" | ||
}, | ||
{ | ||
"bin": "pg_top", | ||
"man": "pg_top.1", | ||
"abstract": "pg_top is 'top' for PostgreSQL" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://pgxn.org/meta/v2/artifacts.schema.json", | ||
"title": "Artifacts", | ||
"description": "*Artifacts* describes non-PGXN links and checksums for downloading the distribution in one or more formats, including source code, binaries, system packages, etc. Consumers **MAY** use this information to determine the best option for installing an extension on a particular system. Useful for projects that publish their own binaries, such as in GitHub releases.", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"format": "uri", | ||
"description": "The URL to download the artifact." | ||
}, | ||
"type": { | ||
"type": "string", | ||
"minLength": 2, | ||
"pattern": "^[a-z0-9]{2,}$", | ||
"description": "The type of artifact. **MUST** be a single lowercase word describing the artifact, such as none of `binary`, `source`, `rpm`, `homebrew`, etc." | ||
}, | ||
"platform": { | ||
"$ref": "platform.schema.json", | ||
"description": "Identifies the platform the artifact was built for. **RECOMMENDED** for packages compiled for a specific platform, such as a C extension compiled for `linux-arm64`." | ||
}, | ||
"sha256": { | ||
"type": "string", | ||
"pattern": "^[0-9a-fA-F]{64}$", | ||
"description": "The SHA-256 checksum for the artifact in hex format." | ||
}, | ||
"sha512": { | ||
"type": "string", | ||
"pattern": "^[0-9a-fA-F]{128}$", | ||
"description": "The SHA-512 checksum for the artifact in hex format." | ||
} | ||
}, | ||
"anyOf": [ | ||
{ "required": ["url", "type", "sha256"] }, | ||
{ "required": ["url", "type", "sha512"] } | ||
], | ||
"patternProperties": { "^[xX]_.": { "description": "Custom key" } }, | ||
"additionalProperties": false | ||
}, | ||
"examples": [ | ||
[ | ||
{ | ||
"type": "source", | ||
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0.zip", | ||
"sha256": "2b9d2416096d2930be51e5332b70bcd97846947777a93e4a3d65fe1b5fd7b004" | ||
}, | ||
{ | ||
"type": "binary", | ||
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0-linux-amd64.tar.gz", | ||
"sha256": "ec33656ba693c01be2b2b500c639846fb0ede7f7f8ee1f4c157bc9cab53c8500" | ||
}, | ||
{ | ||
"type": "binary", | ||
"url": "https://github.com/theory/pg-pair/releases/download/v1.1.0/pair-1.1.0-linux-arm64.tar.gz", | ||
"sha512": "612ad0a8b7e292daf0c723bd0ac8029a838357b2d3abbada7cd7445f7690191abd6593a1336742e705314df81fc1c0063423f62e4abd846f350c251ef6a6a24f" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://pgxn.org/meta/v2/badges.schema.json", | ||
"title": "Badges", | ||
"description": "*Badges* represents links to a [Shields](https://github.com/badges/shields/blob/master/spec/SPECIFICATION.md \"Shields badge specification\")-conformant badges.", | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"src": { | ||
"type": "string", | ||
"format": "uri", | ||
"description": "The URI for the badge." | ||
}, | ||
"alt": { | ||
"type": "string", | ||
"minLength": 4, | ||
"maxLength": 4048, | ||
"description": "Alternate text for accessability." | ||
}, | ||
"url": { | ||
"type": "string", | ||
"format": "uri", | ||
"description": "The URL the badge links to." | ||
} | ||
}, | ||
"required": ["src", "alt"], | ||
"patternProperties": { "^[xX]_.": { "description": "Custom key" } }, | ||
"additionalProperties": false | ||
}, | ||
"examples": [ | ||
[ | ||
{ | ||
"alt": "Test Status", | ||
"src": "https://test.packages.postgresql.org/github.com/example/pair.svg" | ||
} | ||
] | ||
] | ||
} |
Oops, something went wrong.