Skip to content

Commit 60f1616

Browse files
author
Anthony Oliveri
committed
fix(AssistantV1): Remove erroneous additionalProperties from MessageResponse
The Assistant service was never returning additionalProperties for MessageResponse, so this property should have never existed
1 parent 1e14888 commit 60f1616

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

Source/AssistantV1/Models/MessageResponse.swift

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
**/
1616

1717
import Foundation
18-
import RestKit
1918

2019
/**
2120
The response sent by the workspace, including the output text, detected intents and entities, and context.
@@ -58,9 +57,6 @@ public struct MessageResponse: Codable, Equatable {
5857
*/
5958
public var actions: [DialogNodeAction]?
6059

61-
/// Additional properties associated with this model.
62-
public var additionalProperties: [String: JSON]
63-
6460
// Map each property name to the key that shall be used for encoding/decoding.
6561
private enum CodingKeys: String, CodingKey {
6662
case input = "input"
@@ -70,33 +66,6 @@ public struct MessageResponse: Codable, Equatable {
7066
case context = "context"
7167
case output = "output"
7268
case actions = "actions"
73-
static let allValues = [input, intents, entities, alternateIntents, context, output, actions]
74-
}
75-
76-
public init(from decoder: Decoder) throws {
77-
let container = try decoder.container(keyedBy: CodingKeys.self)
78-
input = try container.decodeIfPresent(MessageInput.self, forKey: .input)
79-
intents = try container.decode([RuntimeIntent].self, forKey: .intents)
80-
entities = try container.decode([RuntimeEntity].self, forKey: .entities)
81-
alternateIntents = try container.decodeIfPresent(Bool.self, forKey: .alternateIntents)
82-
context = try container.decode(Context.self, forKey: .context)
83-
output = try container.decode(OutputData.self, forKey: .output)
84-
actions = try container.decodeIfPresent([DialogNodeAction].self, forKey: .actions)
85-
let dynamicContainer = try decoder.container(keyedBy: DynamicKeys.self)
86-
additionalProperties = try dynamicContainer.decode([String: JSON].self, excluding: CodingKeys.allValues)
87-
}
88-
89-
public func encode(to encoder: Encoder) throws {
90-
var container = encoder.container(keyedBy: CodingKeys.self)
91-
try container.encodeIfPresent(input, forKey: .input)
92-
try container.encode(intents, forKey: .intents)
93-
try container.encode(entities, forKey: .entities)
94-
try container.encodeIfPresent(alternateIntents, forKey: .alternateIntents)
95-
try container.encode(context, forKey: .context)
96-
try container.encode(output, forKey: .output)
97-
try container.encodeIfPresent(actions, forKey: .actions)
98-
var dynamicContainer = encoder.container(keyedBy: DynamicKeys.self)
99-
try dynamicContainer.encodeIfPresent(additionalProperties)
10069
}
10170

10271
}

0 commit comments

Comments
 (0)