export class Poco
{
public name: string;
public constructor(init?: Partial<Poco>) { (Object as any).assign(this, init); }
}
export class TestUploadWithDto implements IPost
{
public int: number;
public nullableId?: number;
public long: number;
public double: number;
public string: string;
public dateTime: string;
public intArray?: number[];
public intList?: number[];
public stringArray?: string[];
public stringList?: string[];
public pocoArray?: Poco[];
public pocoList?: Poco[];
public nullableByteArray?: number[];
public nullableByteList?: number[];
public nullableDateTimeArray?: string[];
public nullableDateTimeList?: string[];
public pocoLookup?: { [index:string]: Poco[]; };
public pocoLookupMap?: { [index:string]: { [index:string]: Poco; }[]; };
public mapList?: { [index:string]: string[]; };
public constructor(init?: Partial<TestUploadWithDto>) { (Object as any).assign(this, init); }
}
TypeScript TestUploadWithDto DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/TestUploadWithDto HTTP/1.1
Host: test.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
int: 0,
nullableId: 0,
long: 0,
double: 0,
string: String,
dateTime: 0001-01-01,
intArray:
[
0
],
intList:
[
0
],
stringArray:
[
String
],
stringList:
[
String
],
pocoArray:
[
{
name: String
}
],
pocoList:
[
{
name: String
}
],
nullableByteArray:
[
0
],
nullableByteList:
[
0
],
nullableDateTimeArray:
[
0001-01-01
],
nullableDateTimeList:
[
0001-01-01
],
pocoLookup:
{
String:
[
{
name: String
}
]
},
pocoLookupMap:
{
String:
[
{
String:
{
name: String
}
}
]
},
mapList:
{
String:
[
String
]
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { int: 0, nullableId: 0, long: 0, double: 0, string: String, dateTime: 0001-01-01, intArray: [ 0 ], intList: [ 0 ], stringArray: [ String ], stringList: [ String ], pocoArray: [ { name: String } ], pocoList: [ { name: String } ], nullableByteArray: [ 0 ], nullableByteList: [ 0 ], nullableDateTimeArray: [ 0001-01-01 ], nullableDateTimeList: [ 0001-01-01 ], pocoLookup: { String: [ { name: String } ] }, pocoLookupMap: { String: [ { String: { name: String } } ] }, mapList: { String: [ String ] } }