Improve validation for grafanaDependency (#26936)

This commit is contained in:
Marcus Olsson 2020-08-17 11:59:43 +02:00 committed by GitHub
parent 338943d349
commit 7319527f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ Plugin dependencies.
| Property | Type | Required | Description |
|---------------------|----------|----------|-------------------------------------------------------------------------------------------------------------------------------|
| `grafanaDependency` | string | **Yes** | Required Grafana version for this plugin, e.g. `>=7.0.0` to denote plugin requires Grafana 7.0.0 or later. |
| `grafanaDependency` | string | **Yes** | Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver. |
| `grafanaVersion` | string | No | (Deprecated) Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x. |
| `plugins` | string[] | No | An array of required plugins on which this plugin depends. |

View File

@ -131,8 +131,8 @@
},
"grafanaDependency": {
"type": "string",
"description": "Required Grafana version for this plugin, e.g. `>=7.0.0` to denote plugin requires Grafana 7.0.0 or later.",
"pattern": "^(>=|<|>|<=)?([0-9]+)(\\.[0-9]+)?(\\.[0-9])?$"
"description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.",
"pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*])?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]))?$"
},
"plugins": {
"type": "array",