Tradecraft Garden
Linker Sidecar (Meta-Information API)
Crystal Palace has a JSON-over-HTTP sidecar server to facilitate cross-language access to Crystal Palace. This page describes the .spec meta-information API.
API
The URL endpoint of the .spec file meta-information API is:
POST http://127.0.0.1:60060/info
The URI accepts a POST'd JSON object for commands and arguments.
| Key | Type | Required | Description |
|---|---|---|---|
| files | array | Yes | An array of full paths to specification files |
The Sidecar output is an HTTP 200 OK with a JSON object. If the operation is successful:
| Key | Type | Description |
|---|---|---|
| success | boolean | True, if the operation was successful |
| results | array | An array of objects with one result per parsed file |
| results.0.file | string | full path to the file associated with this result |
| results.0.[...] | string | Each result object has several keys pulled from meta-information in the .spec file. They are: name, targets, license, author, reference, and description |
| results.0.variables | array | An array of objects with one entry per variable accepted by the parsed file |
| results.0.variables.[...] | string | The variable name, description, "default" value, and "allowed" values. No "default" key means no default value is specified |
| errors | array | An array of objects with parser or other errors |
| errors.0.file | string | full path to the file with an error |
| errors.0.message | string | A multi-line string with error information |
If the operation fails, the output is still HTTP 200 OK with a JSON object. But, the success value is false:
| Key | Type | Description |
|---|---|---|
| success | boolean | False, if the operation failed |
| message | string | A multi-line string with the error message |
API JSON Examples
Arguments:
If the operation is successful: