Skip to content

Instantly share code, notes, and snippets.

@sfkleach
Last active January 2, 2023 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfkleach/4065ef69d393c659e297420ebc8c0248 to your computer and use it in GitHub Desktop.
Save sfkleach/4065ef69d393c659e297420ebc8c0248 to your computer and use it in GitHub Desktop.
JSON Schema for findhelp
{
"$id": "https://github.com/GetPoplog/findhelp.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "FindHelp",
"type": "object",
"properties": {
"popversion": {
"description": "A string describing the version of Poplog.",
"type": "string"
},
"documentation": {
"description": "A series of references to Poplog documentation.",
"type": "array",
"items": {
"type": "object",
"properties": {
"quality": {
"description": "A number from 0 to 1.0 indicating the match quality, with 1 being a perfect match.",
"type": "number"
},
"category": {
"description": "The category of documentation, reflecting the level of formality and technical detail.",
"type": "string",
"enum": [ "help", "teach", "doc", "ref" ]
},
"title": {
"description": "The title of the resource.",
"type": "string"
},
"summary": {
"description": "An optional summary of the resource, which is usually a short array of lines but may be null.",
"type": ["array", "null"],
"items": { "type": "string" }
},
"from": {
"description": "Line number where the description starts (1-indexed), which may be null.",
"type": ["integer", "null"]
},
"to": {
"description": "Last line number of the description, which may be null.",
"type": ["integer", "null"]
},
"content": {
"description": "An optional field - the relevant file context as an array of lines, although may be null",
"type": [ "array", "null" ],
"items": { "type": "string" }
}
},
"required": ["quality", "title", "summary", "path", "from", "to", "category"]
}
}
},
"required": ["popversion", "documentation"]
}
@sfkleach
Copy link
Author

Tweaked to remove the restriction on additional properties - that would give us forwards compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment