sourcegraph/schema/opencodegraph.schema.json

83 lines
2.5 KiB
JSON
Raw Normal View History

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "opencodegraph.schema.json#",
"title": "OpenCodeGraphData",
"description": "Metadata about code",
"allowComments": true,
"type": "object",
"additionalProperties": false,
"required": ["items", "annotations"],
"properties": {
"items": {
"type": "array",
"items": { "$ref": "#/definitions/OpenCodeGraphItem" }
},
"annotations": {
"type": "array",
"items": { "$ref": "#/definitions/OpenCodeGraphAnnotation" }
}
},
"definitions": {
"OpenCodeGraphItem": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title"],
"properties": {
"id": { "type": "string" },
"title": { "type": "string" },
"detail": { "type": "string" },
"url": { "description": "An external URL with more information.", "type": "string", "format": "uri" },
"preview": { "description": "Show a preview of the link.", "type": "boolean" },
"previewUrl": {
"description": "If `preview` is set, show this URL as the preview instead of `url`.",
"type": "string"
},
"image": { "$ref": "#/definitions/OpenCodeGraphImage" }
}
},
"OpenCodeGraphImage": {
"type": "object",
"additionalProperties": false,
"required": ["url"],
"properties": {
"url": { "type": "string", "format": "uri" },
"width": { "type": "number" },
"height": { "type": "number" },
"alt": { "type": "string" }
}
},
"OpenCodeGraphAnnotation": {
"type": "object",
"additionalProperties": false,
"required": ["range", "item"],
"properties": {
"range": { "$ref": "#/definitions/OpenCodeGraphRange" },
"item": {
"title": "OpenCodeGraphItemRef",
"type": "object",
"additionalProperties": false,
"required": ["id"],
"properties": {
"id": { "type": "string" }
}
}
}
},
"OpenCodeGraphRange": {
"type": "object",
"additionalProperties": false,
"required": ["start", "end"],
"properties": {
"start": { "$ref": "#/definitions/OpenCodeGraphPosition" },
"end": { "$ref": "#/definitions/OpenCodeGraphPosition" }
}
},
"OpenCodeGraphPosition": {
"type": "object",
"additionalProperties": false,
"required": ["line", "character"],
"properties": { "line": { "type": "integer" }, "character": { "type": "integer" } }
}
}
}