<commit_before>The json message serializer is meant to be used by client connections.
One sample usage is websocket based connections.

Limitations:
 * No support for serializing object graphs.

Features:
 * Adds the field "@type" with to objects whose type is ambiguous during serialization.
    * "@type" by default will contain the orbit classId of the object: <br/>
      Usually `object.getClass().getName().replace('$','.').hashcode()`.
    * Will use the field "@type" resolve type ambiguities during deserialization.


Message format
----
```
{
  "messageType" : int8       // 0 = oneWay; 1 = request; 2,3,4 - responses
  "messageId"   : int32,     // unique messageId (required for responses and requests)
  "interfaceId" : int32,     // target actor interface Id (required for oneway and requests)
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id (required for oneway and requests, may be null depending of the target)
  "methodId"    : int32,     // target method id (required for oneway and requests)
  "payload"     : any        // array, map, number, string, boolean, null (required may be null)
}
```

Message types:
----

0. One way: No response will be sent
1. Request: A response will be sent
2. Response: A normal response
3. Error Response: A normal response
4. Protocol Error Response: An error occurred with the protocol. Usually invalid data.


One way messages:
```
{
  "messageType" : 0          // 0 = one way
  "messageId"   : int32,     // unique messageId, optional, recommended.
  "interfaceId" : int32,     // target actor interface Id
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id
  "methodId"    : int32,     // target method id
  "payload"     : any        // parameter array, required, unless void method
}
```

Request way messages:
```
{
  "messageType" : 1          // 1 = request
  "messageId"   : int32,     // unique messageId
  "interfaceId" : int32,     // target actor interface Id
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id
  "methodId"    : int32,     // target method id
  "payload"     : any        // parameter array, required, unless void method
}
```

Response Messages
```
{
  "messageType" : 2          // 2,3,4 = responses
  "messageId"   : int32,     // original request messageId
  "headers"     : { }        // map with the message headers, optional
  "payload"     : any        // required, unless null. may be: string, number, boolean, null, array, map
}
```<commit_msg>Fixed formatting.<commit_after>The json message serializer is meant to be used by client connections.
One sample usage is websocket based connections.

Limitations:

 * No support for serializing object graphs.

Features:

 * Adds the field "@type" with to objects whose type is ambiguous during serialization.
    * "@type" by default will contain the orbit classId of the object: <br/>
      Usually `object.getClass().getName().replace('$','.').hashcode()`.
    * Will use the field "@type" resolve type ambiguities during deserialization.


Message format
----

```json
{
  "messageType" : int8       // 0 = oneWay; 1 = request; 2,3,4 - responses
  "messageId"   : int32,     // unique messageId (required for responses and requests)
  "interfaceId" : int32,     // target actor interface Id (required for oneway and requests)
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id (required for oneway and requests, may be null depending of the target)
  "methodId"    : int32,     // target method id (required for oneway and requests)
  "payload"     : any        // array, map, number, string, boolean, null (required may be null)
}
```

Message types:
----

0. One way: No response will be sent
1. Request: A response will be sent
2. Response: A normal response
3. Error Response: A normal response
4. Protocol Error Response: An error occurred with the protocol. Usually invalid data.


One way messages:

```json
{
  "messageType" : 0          // 0 = one way
  "messageId"   : int32,     // unique messageId, optional, recommended.
  "interfaceId" : int32,     // target actor interface Id
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id
  "methodId"    : int32,     // target method id
  "payload"     : any        // parameter array, required, unless void method
}
```

Request way messages:

```json
{
  "messageType" : 1          // 1 = request
  "messageId"   : int32,     // unique messageId
  "interfaceId" : int32,     // target actor interface Id
  "headers"     : { }        // map with the message headers, optional
  "objectId"    : string     // actor Id
  "methodId"    : int32,     // target method id
  "payload"     : any        // parameter array, required, unless void method
}
```

Response Messages

```json
{
  "messageType" : 2          // 2,3,4 = responses
  "messageId"   : int32,     // original request messageId
  "headers"     : { }        // map with the message headers, optional
  "payload"     : any        // required, unless null. may be: string, number, boolean, null, array, map
}
```
{'fraction_non_alphanumeric': 0.1115530303030303, 'fraction_numerical': 0.014772727272727272, 'mean_word_length': 2.5658338960162053, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503229', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1469, 'n_words': 597}