This is an automated email from the ASF dual-hosted git repository.

simonetripodi pushed a commit to branch feature-schema
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature.git

commit 5f053b5981e4b352a7b9e4ef14911908ebabcfa1
Author: Simo Tripodi <[email protected]>
AuthorDate: Mon Oct 8 22:10:24 2018 +0200

    SLING-7990 - Define an initial version of the Feature Model JSON Shema
    
    initial version
---
 pom.xml                          |   1 +
 schema/Feature-1.0.0.schema.json | 220 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 221 insertions(+)

diff --git a/pom.xml b/pom.xml
index 336ee78..d285b50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,6 +64,7 @@
                 <configuration>
                     <excludes>
                         <exclude>*.md</exclude>
+                        <exclude>schema/Feature-1.0.0.schema.json</exclude>
                     </excludes>
                 </configuration>
             </plugin>
diff --git a/schema/Feature-1.0.0.schema.json b/schema/Feature-1.0.0.schema.json
new file mode 100644
index 0000000..0bc0c36
--- /dev/null
+++ b/schema/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" ]
+            }
+          }
+        }
+      }
+    }
+  }
+}

Reply via email to