Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "BaSyx / Documentation / VAB / JSON Serialization"
(Explanation of JSON serialization) |
(Removes references to Set support) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
| [[BaSyx_/_Documentation_/_VAB_/_HTTP_Mapping | HTTP/REST Mapping]] | | [[BaSyx_/_Documentation_/_VAB_/_HTTP_Mapping | HTTP/REST Mapping]] | ||
| [[BaSyx_/_Documentation_/_VAB_/_TCP_Mapping | TCP Mapping]] | | [[BaSyx_/_Documentation_/_VAB_/_TCP_Mapping | TCP Mapping]] | ||
+ | | [[BaSyx_/_Documentation_/_VAB_/_Exceptions | Exceptions]] | ||
|} | |} | ||
= JSON Serialization = | = JSON Serialization = | ||
Line 23: | Line 24: | ||
Additionally, these types are introduced: | Additionally, these types are introduced: | ||
*ordered lists | *ordered lists | ||
− | |||
*functions | *functions | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Functions === | === Functions === |
Latest revision as of 07:54, 7 August 2020
See also | HTTP/REST Mapping | TCP Mapping | Exceptions |
---|
JSON Serialization
Both the TCP and the HTTP mapping use a json serialization for objects send over the VAB. In the following, this json serialization is explained.
Requirements
There are multiple requirements on the JSON serialization:
- Preserve type information, since JSON only knows a small set of types
- Be compatible to the JSON serialization defined in Details of the Asset Administration Shell
- Be compatible to the C#-SDK since it is not using the VAB
Type Representation
The following types are taken as is from the JSON type scheme:
- string
- number (integer or double)
- object (i.e. map)
- boolean
- null
Additionally, these types are introduced:
- ordered lists
- functions
Functions
Functions are most commonly not serializable. Exception of this are Java functions, that can be represented by their byte code. However, there still needs to be an indication that a value is representing a function. This is done by passing this information in the _basyxFunctionType key. The allowed values are:
- lambda
- operation