import Foundation
import ServiceStack
public class GetJsonTemplateInfos : JsonDto
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class JsonDto : Codable
{
required public init(){}
}
public class GetJsonTemplateInfosResponse : JsonDto
{
public var templateInfos:[JsonTemplateInfo] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case templateInfos
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
templateInfos = try container.decodeIfPresent([JsonTemplateInfo].self, forKey: .templateInfos) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if templateInfos.count > 0 { try container.encode(templateInfos, forKey: .templateInfos) }
}
}
public class JsonTemplateInfo : Codable
{
public var guid:String
public var templateModificationDate:Date
public var iconModificationDate:Date
required public init(){}
}
Swift GetJsonTemplateInfos DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsonl/reply/GetJsonTemplateInfos HTTP/1.1
Host: buildmax.org
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{Unable to show example output for type 'GetJsonTemplateInfosResponse' using the custom 'other' filter}No parameterless constructor defined for this object.