Skip to content

Instantly share code, notes, and snippets.

@epost
Last active November 16, 2015 14:57
Show Gist options
  • Save epost/4a3a04046a94139b2ab1 to your computer and use it in GitHub Desktop.
Save epost/4a3a04046a94139b2ab1 to your computer and use it in GitHub Desktop.
JSON schema for psc-ide
[
{
"module": "Data.Array",
"identifier": "filter",
"type": "forall a. (a -> Boolean) -> Array a -> Array a"
},
{
"module": "Data.Array",
"identifier": "map",
"type": "forall a b. (a -> b) -> Array a -> Array b"
}
]
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "psc-ide schema",
"type": "array",
"items": {
"title": "Completion results",
"type": "object",
"properties": {
"module": {
"description": "The module in which the identifier is defined.",
"$ref": "#/definitions/moduleIdentifierQ",
},
"identifier": {
"type": "string"
},
"type": {
"description": "The type of the identifier.",
"type": "string",
"minimum": 0
}
},
"required": ["module", "identifier", "type"]
},
"definitions": {
"moduleIdentifierQ": {
"pattern": "^[A-Z][A-Za-z0-9_]*(\\.[A-Z][A-Za-z0-9_]*)*$",
"type": "string"
}
}
}
@epost
Copy link
Author

epost commented Nov 16, 2015

try the schema and exmaple here: http://www.jsonschemavalidator.net/

psc-ide protocol description: https://github.com/kRITZCREEK/psc-ide/blob/master/PROTOCOL.md

json-schema examples: http://json-schema.org/example1.html.

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