{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "http://download.gebrproject.com/pub/schema/flow.schema",
    "title": "Flow",
    "description": "A sequence of programs working on a data",
    "type": "object",
    "properties": {
	"title": {
	    "description": "Short title for the flow",
	    "type": "string",
	    "maxLength": 40
	},

	"description": { "$ref": "/pub/schema/desc.schema" },
	
	"credits": {
	    "description": "Credits for the flow",
	    "type": "array",
	    "items": { "$ref": "/pub/schema/person.schema" }
	},

	"io": {
	    "description": "list of files to connect to standard input and outputs",
	    "type": "object",
	    "properties": {
		"stdin":  {"type": "string", "description": "file to feed the standard input"},
		"stdout": {
		    "type": "array",
		    "description": "file to be written by the standard output",
		    "items": [
			{ "type": "string" },
			{ "enum": [ "w", "a" ]}
		    ]
		},
		"stderr": {
		    "type": "array",
		    "description": "file to be written by the standard error",
		    "items": [
			{ "type": "string" },
			{ "enum": [ "w", "a" ]}
		    ]
		}
	    },
	    "additionalProperties": false
	},
	
	"programs": {
	    "description": "List of programs",
	    "type": "array",
	    "items": {
		"description": "A program with its status in the flow",
		"type": "object",
		"properties": {
		    "enabled": { "type": "boolean" },
		    "program": { "$ref": "/pub/schema/program.schema" }
		}
	    }
	}
    },
    "required": [ "title" ],
    "additionalProperties": false
}