Removes "type" from json format. Was pointless. (#783)

This commit is contained in:
Travis Reeder
2018-02-20 12:04:08 -08:00
committed by Reed Allman
parent cebae57007
commit 575e1d3d0c
3 changed files with 1 additions and 8 deletions

View File

@@ -30,7 +30,6 @@ type CallResponseHTTP struct {
// jsonIn We're not using this since we're writing JSON directly right now, but trying to keep it current anyways, much easier to read/follow
type jsonIn struct {
CallID string `json:"call_id"`
Type string `json:"type"`
Deadline string `json:"deadline"`
Body string `json:"body"`
ContentType string `json:"content_type"`
@@ -71,7 +70,6 @@ func (h *JSONProtocol) writeJSONToContainer(ci CallInfo) error {
Body: body,
ContentType: ci.ContentType(),
CallID: ci.CallID(),
Type: ci.CallType(),
Deadline: ci.Deadline().String(),
Protocol: CallRequestHTTP{
Type: ci.ProtocolType(),

View File

@@ -80,10 +80,6 @@ func TestJSONProtocolwriteJSONInputRequestBasicFields(t *testing.T) {
t.Errorf("Request ContentType assertion mismatch: expected: %s, got %s",
ci.ContentType(), incomingReq.ContentType)
}
if incomingReq.Type != ci.CallType() {
t.Errorf("Request CallType assertion mismatch: expected: %s, got %s",
ci.CallType(), incomingReq.Type)
}
if incomingReq.Deadline != ci.Deadline().String() {
t.Errorf("Request Deadline assertion mismatch: expected: %s, got %s",
ci.Deadline(), incomingReq.Deadline)

View File

@@ -84,7 +84,6 @@ Internally functions receive data in the example format below:
{
"call_id": "123",
"content_type": "application/json",
"type":"sync",
"deadline":"2018-01-30T16:52:39.786Z",
"body": "{\"some\":\"input\"}",
"protocol": {
@@ -103,9 +102,9 @@ BLANK LINE
}
```
* body - the main contents. If HTTP is the protocol, this would be the request body.
* call_id - the unique ID for the call.
* content_type - format of the `body` parameter.
* type - whether the call was sync or async.
* deadline - a time limit for the call, based on function timeout.
* protocol - arbitrary map of protocol specific data. The above example shows what the HTTP protocol handler passes in. Subject to change and reduces reusability of your functions. **USE AT YOUR OWN RISK**.