Skip to content
pkm-config-schema.json 8.78 KiB
Newer Older
{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://gitlab.ow2.org/decoder/pkm-api/-/tree/master/api/pkm-config-schema.json",
	"title": "PKM configuration file JSON Schema.",
	"description": "PKM configuration file JSON Schema.",
	"type": "object",
	"properties":
	{
		"debug":
		{
			"type": "boolean",
			"description": "enable/disable debug message",
			"default": "false"
		},
		"pkm_db":
		{
			"type": "string",
			"description": "MongoDB PKM management database",
			"default": "pkm"
		},
		"session_timeout":
		{
			"type": "string",
			"description": "user's session timeout delay",
			"default": "1 d"
		},
		"secret_file":
		{
			"type": "string",
			"description": "path to secret file (>= 32 random chars)"
		},
		"git_root_directory":
		{
			"type": "string",
			"description": "path to the root directory for all the Git working trees"
		},
		"git_max_parallel_read_files":
		{
			"type": "integer",
			"description": "Max parallel read operations while reading files from a Git working tree"
		},
		"git_max_parallel_read_files":
		{
			"type": "integer",
			"description": "Max parallel write operations while writing files from a Git working tree"
		},
		"git_remote_timeout":
		{
			"type": "string",
			"description": "timeout delay when running a Git command which targets a remote server and possibly requires an authentication which may block the PKM server",
			"default": "10 m"
		},
		"db_host":
		{
			"type": "string",
			"description": "MongoDB host",
			"default": "pkm-api_mongodb_1:27017"
		},
		"server_request_body_limit":
		{
			"type": "string",
			"description": "Max size of request body that the REST server accepts",
			"default": "256MB"
		},
		"project":
		{
			"type": "object",
			"description": "Predefined content of project metadata actually stored in Collections Tools, TESTARSettings, and MethodologyStatus",
			"properties":
			{
				"tools":
				{
					"$ref": "#/definitions/ProjectMetaDataPredefinedContent"
				},
				"testarSettings":
				{
					"$ref": "#/definitions/ProjectMetaDataPredefinedContent"
				},
				"methodologyStatus":
				{
					"$ref": "#/definitions/ProjectMetaDataPredefinedContent"
				}
			}
		},
			"descriptions": "set of schemas for the JSON documents for each collections in the MongoDB database",
					"$ref": "#/definitions/CollectionSchema"
				},
				"TESTARSettings":
				{
					"$ref": "#/definitions/CollectionSchema"
				},
				"MethodologyStatus":
				{
					"$ref": "#/definitions/CollectionSchema"
				},
				"Reviews":
				{
					"$ref": "#/definitions/CollectionSchema"
				}
			}
		},
		"types":
		{
			"type": "object",
			"descriptions": "set of default artefact types from the GUI front-end point of view for each collections in the MongoDB database",
			"properties":
			{
				"Annotations":
				{
					"type": "string"
				},
				"RawSourcecode":
				{
					"type": "string"
				},
				"RawUML":
				{
					"type": "string"
				},
				"sourcecodeC":
				{
					"type": "string"
				},
				"sourcecodeCPP":
				{
					"type": "string"
				},
				"sourcecodeJava":
				{
					"type": "string"
				},
				"annotationsACSL":
				{
					"type": "string"
				},
				"commentsC":
				{
					"type": "string"
				},
				"commentsCPP":
				{
					"type": "string"
				},
				"commentsjava":
				{
					"type": "string"
				},
				"annotationsACSLPP":
				{
					"type": "string"
				},
				"annotationsJML":
				{
					"type": "string"
				},
				"UMLClasses":
				{
					"type": "string"
				},
				"StateMachineModels":
				{
					"type": "string"
				},
				"TESTARStateModels":
				{
					"type": "string"
				},
				"TESTARTestResults":
				{
					"type": "string"
				},
				"CompileCommands":
				{
					"type": "string"
				},
				"TraceabilityMatrix":
				{
					"type": "string"
				},
				"Logs":
				{
					"type": "string"
				},
				"RawDocumentation":
				{
					"type": "string"
				},
				"Documentation":
				{
					"type": "string"
				},
				"CVEList":
				{
					"type": "string"
				},
				"RawBinaries":
				{
					"type": "string"
				},
				"GitWorkingTree":
				{
					"type": "string"
				},
				"Tools":
				{
					"type": "string"
				},
				"Invocations":
				{
					"type": "string"
				},
				"TESTARSettings":
				{
					"type": "string"
				},
				"MethodologyStatus":
				{
					"type": "string"
				},
				"Reviews":
				{
					"type": "string"
				}
			}
		},
		"file_types":
		{
			"type": "array",
			"description": "set of rules to guess missing PKM file properties and destination collection",
			"items":
			{
				"$ref": "#/definitions/FileTypeRule"
			}
		}
	},
	"definitions":
	{
		"ProjectMetaDataPredefinedContent":
		{
			"type": "object",
			"properties":
			{
				"files":
					"type": "array",
					"items":
					{
						"type": "string",
						"description": "path to a JSON file"
					}
					"type": "string",
					"description": "path to a JSON file"
				"oneOf":
				[
					{ "required" : [ "files" ] },
					{ "required" : [ "file" ] }
				]
			}
		},
		"CollectionSchema":
		{
			"type": "object",
			"properties":
			{
				"file":
					"type": "string",
					"description": "path to the JSON schema file"
					"type": "boolean",
					"description": "enable/disable schema validation"
					{
						"type": "string",
						"description": "filename suffix",
						"example": ".java"
					}
				},
				"format":
				{
					"type": "string",
					"description": "file format",
					"enum": [ "text", "binary" ]
				},
				"mime_types":
				{
					"type": "array",
					"items":
					{
						"type": "string",
						"description": "MIME type",
						"example": "text/x-java-source"
					}
				},
				"type":
				{
					"type": "string",
					"description": "type of the file from the GUI front-end point of view",
					"enum": [ "Code", "Diagram", "Doc", "Annotation", "Comment", "Log" ]
				},
				"collection":
				{
					"type": "string",
					"description": "MongoDB collection where to dispatch the file",
					"enum":
					[
						"Annotations",
						"RawSourcecode",
						"RawUML",
						"sourcecodeC",
						"sourcecodeCPP",
						"sourcecodeJava",
						"annotationsACSL",
						"annotationsACSLPP",
						"annotationsJML",
						"commentsC",
						"commentsCPP",
						"commentsjava",
						"RawDocumentation",
						"Documentation",
						"UMLClasses",
						"UMLStateMachines",
						"TESTARStateModels",
						"TESTARTestResults",
						"Logs",
						"TraceabilityMatrix",
						"Project",
						"CompileCommands",
						"OpenJMLAnalysis",
						"CVEList",
						"RawBinaries",
						"GitWorkingTrees",
						"Tools",
						"Invocations",
						"TESTARSettings",
						"MethodologyStatus",
						"Reviews"