44 lines
1.2 KiB
JSON
44 lines
1.2 KiB
JSON
|
|
{
|
||
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||
|
|
"$id": "https://whetstone-dsl.org/schemas/methods/parseSource.schema.json",
|
||
|
|
"title": "parseSource",
|
||
|
|
"description": "Parse source code into an AST",
|
||
|
|
"type": "object",
|
||
|
|
"properties": {
|
||
|
|
"request": {
|
||
|
|
"type": "object",
|
||
|
|
"properties": {
|
||
|
|
"source": {
|
||
|
|
"type": "string",
|
||
|
|
"description": "The source code to parse"
|
||
|
|
},
|
||
|
|
"language": {
|
||
|
|
"type": "string",
|
||
|
|
"description": "The source language (e.g., 'python', 'javascript')"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"required": ["source", "language"],
|
||
|
|
"additionalProperties": false
|
||
|
|
},
|
||
|
|
"response": {
|
||
|
|
"type": "object",
|
||
|
|
"properties": {
|
||
|
|
"ast": {
|
||
|
|
"type": "object",
|
||
|
|
"description": "The parsed AST (null if parsing failed)"
|
||
|
|
},
|
||
|
|
"diagnostics": {
|
||
|
|
"type": "array",
|
||
|
|
"items": {
|
||
|
|
"$ref": "../types/ParseDiagnostic.schema.json"
|
||
|
|
},
|
||
|
|
"description": "Array of parse diagnostics"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"required": ["diagnostics"],
|
||
|
|
"additionalProperties": false
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"required": ["request", "response"]
|
||
|
|
}
|