Skip to content

Provide the schema for the self-update versions.json #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions v1/self-update-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/versions-schema.json",
"title": "Versions Schema",
"description": "Schema for versions list for PHPCQ self-update",
"type": "object",
"properties": {
"updated": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the last update"
},
"versions": {
"type": "array",
"description": "List of available versions",
"items": {
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "Version number following the semver standard"
},
"phar": {
"type": "string",
"description": "File path of the phar file relative to the versions.json"
},
"signature": {
"type": [ "string", "null" ],
"description": "File path of the signature file relative to the versions.json"
},
"requirements": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can re-use the PhpPlatformRequirements schema here
If we can't, the constraint schema (see below for version annotation) should at least be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can, but we fix it first and handle all platform requirements according to https://getcomposer.org/doc/articles/composer-platform-dependencies.md#different-types-of-platform-packages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is missing there?
Do you mean to restrict the name with the various prefixes?

"type": "object",
"description": "Abhängigkeiten der Version",
"properties": {
"php": {
"type": "string",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we reuse the constraint schema here?

"description": "PHP requirement"
}
},
"patternProperties": {
"^ext-[a-zA-Z0-9_-]+$": {
"type": "string",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we reuse the constraint schema here?

"description": "PHP extension requirement"
}
},
"additionalProperties": true
}
},
"required": ["version", "phar", "signature", "requirements"],
"additionalProperties": false
}
}
},
"required": ["updated", "versions"],
"additionalProperties": false
}