You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by si...@apache.org on 2018/11/08 11:01:31 UTC
[sling-org-apache-sling-feature-io] branch SLING-8032 created (now
32537cd)
This is an automated email from the ASF dual-hosted git repository.
simonetripodi pushed a change to branch SLING-8032
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-io.git.
at 32537cd SLING-8032 - Add a MOJO which is able to validate JSON Feature file against the JSON Schema
This branch includes the following new commits:
new 32537cd SLING-8032 - Add a MOJO which is able to validate JSON Feature file against the JSON Schema
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[sling-org-apache-sling-feature-io] 01/01: SLING-8032 - Add a MOJO
which is able to validate JSON Feature file against the JSON Schema
Posted by si...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
simonetripodi pushed a commit to branch SLING-8032
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-io.git
commit 32537cd72170295427d22db97d86ac1837f4898e
Author: Simo Tripodi <st...@adobe.com>
AuthorDate: Thu Nov 8 12:01:14 2018 +0100
SLING-8032 - Add a MOJO which is able to validate JSON Feature file
against the JSON Schema
schema definition moved from sling-org-apache-sling-feature to
sling-org-apache-sling-feature-io
---
.../META-INF/feature/Feature-1.0.0.schema.json | 220 +++++++++++++++++++++
1 file changed, 220 insertions(+)
diff --git a/src/main/resources/META-INF/feature/Feature-1.0.0.schema.json b/src/main/resources/META-INF/feature/Feature-1.0.0.schema.json
new file mode 100644
index 0000000..0bc0c36
--- /dev/null
+++ b/src/main/resources/META-INF/feature/Feature-1.0.0.schema.json
@@ -0,0 +1,220 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$id": "http://sling.apache.org/Feature/1.0.0",
+ "type": "object",
+ "properties": {
+ "model-version": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string",
+ "pattern": "^(([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)|([^/ ]+)/([^/ ]+)(/([^/ ]+))?(/([^/ ]*)(/([^/ ]+))?)?)$"
+ },
+ "title": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "vendor": {
+ "type": "string"
+ },
+ "license": {
+ "type": "string"
+ },
+ "variables": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": "string"
+ }
+ }
+ },
+ "bundles": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Bundle"
+ }
+ },
+ "framework-properties": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": [ "string", "number", "boolean" ]
+ }
+ }
+ },
+ "configurations": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "$ref": "#/definitions/Configuration"
+ }
+ }
+ },
+ "include": {
+ "$ref": "#/definitions/Include"
+ },
+ "requirements": {
+ " type": "array",
+ "items": {
+ "$ref": "#/definitions/Requirement"
+ }
+ },
+ "capabilities": {
+ " type": "array",
+ "items": {
+ "$ref": "#/definitions/Capability"
+ }
+ }
+ },
+ "patternProperties": {
+ "^[^:]+:ARTIFACTS\\|(true|false)$": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Bundle"
+ }
+ },
+ "^[^:]+:TEXT\\|(true|false)$": {
+ "type": [ "string", "array" ],
+ "items": {
+ "type": "string"
+ }
+ },
+ "^[^:]+:JSON\\|(true|false)$": {
+ "type": [
+ "object",
+ "array"
+ ]
+ }
+ },
+ "definitions": {
+ "Bundle": {
+ "$id": "#Bundle",
+ "type": [
+ "string",
+ "object"
+ ],
+ "properties": {
+ "id": {
+ "type": "string",
+ "pattern": "^(([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)|(mvn:)?([^/ ]+)/([^/ ]+)(/([^/ ]+))?(/([^/ ]*)(/([^/ ]+))?)?)$"
+ },
+ "start-level": {
+ "type": [ "string", "number" ],
+ "pattern": "^\\d+$"
+ },
+ "run-modes": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "items": {
+ "type": "string"
+ }
+ },
+ "configurations": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "$ref": "#/definitions/Configuration"
+ }
+ }
+ }
+ }
+ },
+ "Configuration": {
+ "$id": "#Configuration",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": [
+ "string",
+ "number",
+ "boolean",
+ "array",
+ "object"
+ ]
+ }
+ }
+ },
+ "Include": {
+ "$id": "#Include",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "pattern": "^(([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)|(mvn:)?([^/ ]+)/([^/ ]+)(/([^/ ]+))?(/([^/ ]*)(/([^/ ]+))?)?)$"
+ },
+ "removals": {
+ "$ref": "#/definitions/Removals"
+ }
+ }
+ },
+ "Removals": {
+ "$id": "#Removals",
+ "type": "object",
+ "properties": {
+ "configurations": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "bundles": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "framework-properties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "Requirement": {
+ "$id": "#Requirement",
+ "type": "object",
+ "properties": {
+ "namespace": {
+ "type": "string"
+ },
+ "directives": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "Capability": {
+ "$id": "#Capability",
+ "type": "object",
+ "properties": {
+ "namespace": {
+ "type": "string"
+ },
+ "directives": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": "string"
+ }
+ }
+ },
+ "attributes": {
+ "type": "object",
+ "patternProperties": {
+ "^(.+)$": {
+ "type": [ "string", "number", "boolean" ]
+ }
+ }
+ }
+ }
+ }
+ }
+}