All Verbs | /testdata/AllCollectionTypes |
---|
export class Poco
{
public name: string;
public constructor(init?: Partial<Poco>) { (Object as any).assign(this, init); }
}
export class AllCollectionTypes
{
public intArray: number[] = [];
public intList: number[] = [];
public stringArray: string[] = [];
public stringList: string[] = [];
public floatArray: number[] = [];
public doubleList: number[] = [];
public byteArray: string = [];
public charArray: string[] = [];
public decimalList: number[] = [];
public pocoArray: Poco[] = [];
public pocoList: Poco[] = [];
public pocoLookup: { [index:string]: Poco[]; } = {};
public pocoLookupMap: { [index:string]: { [index:string]: Poco; }[]; } = {};
public constructor(init?: Partial<AllCollectionTypes>) { (Object as any).assign(this, init); }
}
export class TestDataAllCollectionTypes
{
public constructor(init?: Partial<TestDataAllCollectionTypes>) { (Object as any).assign(this, init); }
}
TypeScript TestDataAllCollectionTypes 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 /testdata/AllCollectionTypes HTTP/1.1
Host: test.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { intArray: [ 0 ], intList: [ 0 ], stringArray: [ String ], stringList: [ String ], floatArray: [ 0 ], doubleList: [ 0 ], byteArray: AA==, charArray: [ ], decimalList: [ 0 ], pocoArray: [ { name: String } ], pocoList: [ { name: String } ], pocoLookup: { String: [ { name: String } ] }, pocoLookupMap: { String: [ { String: { name: String } } ] } }