-
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.
add json schema to validate the class yaml files
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 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
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,89 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"title": "Module class yaml", | ||
"description": "Validate the yaml file for a module class", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Name of the class" | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Description of the class" | ||
}, | ||
"keywords": { | ||
"type": "array", | ||
"description": "Keywords for the class", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 3 | ||
}, | ||
"input": { | ||
"type": "array", | ||
"description": "Input channels for the class modules", | ||
"items": { | ||
"type": "array", | ||
"items": { "$ref": "#/definitions/elementProperties" } | ||
} | ||
}, | ||
"output": { | ||
"type": "array", | ||
"description": "Output channels for the class modules", | ||
"items": { | ||
"type": "object", | ||
"items": { "$ref": "#/definitions/elementProperties" } | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"elementProperties": { | ||
"type": "object", | ||
"patternProperties": { | ||
".*": { | ||
"type": "object", | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"description": "Type of the channel element", | ||
"enum": ["map", "file", "directory", "string", "integer", "float", "boolean", "list"] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "Description of the channel" | ||
}, | ||
"pattern": { | ||
"type": "string", | ||
"description": "Pattern of the channel, given in Java glob syntax" | ||
}, | ||
"enum": { | ||
"type": "array", | ||
"description": "List of allowed values for the channel", | ||
"items": { | ||
"type": ["string", "number", "boolean", "array", "object"] | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"ontologies": { | ||
"type": "array", | ||
"description": "List of ontologies for the channel", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "object", | ||
"patternProperties": { | ||
".*": { | ||
"type": "string", | ||
"pattern": "^(http|https)://.*" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"required": ["type", "description"] | ||
} | ||
} | ||
} | ||
}, | ||
"required": ["name", "description", "keywords", "input", "output"] | ||
} |
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