Commit f82f61d0 authored by Siebers, Michael's avatar Siebers, Michael
Browse files

Prepare response schema for /explain.

parent b6b23ae4
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "response-explain-schema.json",
"title": "Explanations Response",
"description": "The response body when querying an explanation for the irrelevancy of a file.",
"type": "object",
"properties": {
"explanations": {
"description": "A list of explanations.",
"type": "array",
"items": {
"type": "object",
"properties": {
"abs_path": {
"description": "The path of the irrelevant file this explanation is for.",
"$ref": "type-abs_path-schema.json"
},
"reasoning": {
"description": "The top-view reason why the file is irrelevant.",
"$ref": "#/definitions/message"
},
"reasoning_details": {
"description": "A point-by-point detailed reasoning why this file is irrelevant.",
"type": "array",
"items": {"$ref": "#/definitions/message"}
},
"references": {
"description": "A list of 'real-world' file system references. Message parts might relate to these.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "A (for this explanation) unique identifier for this reference.",
"type": "integer",
"minimum": 0
},
"referenced_entities": {
"description": "A list of real-world references.",
"type": "array",
"items": {
"type": "object",
"properties": {
"abs_path": {
"description": "The absolute path of the referenced item.",
"$ref": "type-abs_path-schema.json"
},
"property": {
"description": "The real-world property of the item that is references, like it's 'name' or its 'size'.",
"type": "string",
"minimumLength": 1
}
}
}
}
}
}
}
}
}
},
"further_explanations": {"type": "boolean"}
},
"definitions": {
"message_part": {
"description": "A small part of a message possibly relating to a reference.",
"type": "object",
"properties": {
"text": {"type": "string", "minimumLength": 1},
"ref_id": {"type": "integer", "minimum": 0}
},
"required": ["text"],
"additionalProperties": false
},
"message": {
"description": "A complete message.",
"type": "array",
"items": {
"$ref": "#/definitions/message_part"
}
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "type-abs_path-schema.json",
"title": "Absolute Path",
"description": "An absolute path.",
"type": "string",
"pattern": "^(/|.*[^/])$"
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment