Last updated
Last updated
Retrieve the object reached thru the given URI.
This This URI starts with a pinned object ID and contains a variable part, /*
, that indicates the path from the root (pinned) object to the slot of interest, thru a chain of slots.
Slots might be named or indexed depending on the object class. In the former case, they will correspond to instance variable names while in the latter they will correspond to the indexes between 1
and the size of the object. In any case, they should be known before requesting a given slot. See examples below.
It should be also possible to get the list of both named or indexed slots at once by means named-slots
or indexed-slots
, respectively. See examples below.
Finally, custom object views could be available from custom-views
segment. See below.
URL: /objects/{id}/*
Method: GET
Code : 200 OK
Content: object
defined as:
Example 1:: corner
slot of the rectangle with ID 1
, GET /objects/1/corner
Example 2:: x
slot of the corner
slot of the rectangle with ID 1
, GET /objects/1/corner/x
Example 3:: named-slots
of the rectangle with ID 1
, GET /objects/1/named-slots
Note the slot
property in each object.
Example 4:: named-slots
of the corner
slot of the rectangle with ID 1
, GET /objects/1/corner/named-slots
Example 5:: indexed-slots
of the array with ID 1
, GET /objects/1/indexed-slots
Example 6:: element at index 2
of the same array as before, GET /objects/1/2
Custom views give the chance to specify special ways of viewing an object. The consumer of the API can take advantage of these specifications and display different views accordingly.
For example, at the moment of writing this documentation, the IDE supports the following views list
, table
, tree
, source
, html
and markdown
. These views are available in the Inspector.
Custom views should be accessible through /custom-views
segment.
For example, lets suppose there is a instance of a tree-like object in your system pinned with the ID 3. Responding to GET /objects/2/custom-views
with the following specification will enable a tree titled "Tree View"
.
The JSON structure for this type of view should be a list of node
, where a node
should have this properties:
It is possible to use other properties than label
and children
(default ones), provided they are specified in nodeLabel
and nodeChildren
, respectively.
For instance, the same example but with custom properties name
and decendents
:
Here is another example using the type html
. This type is the most flexible as an object can specify any arbitrary HTML code.