Test

<back to all web services

AllCollectionTypes

"use strict";
export class Poco {
    /** @param {{name?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    name;
}
export class AllCollectionTypes {
    /** @param {{intArray?:number[],intList?:number[],stringArray?:string[],stringList?:string[],floatArray?:number[],doubleList?:number[],byteArray?:string,charArray?:string[],decimalList?:number[],pocoArray?:Poco[],pocoList?:Poco[],pocoLookup?:{ [index: string]: Poco[]; },pocoLookupMap?:{ [index: string]: { [index:string]: Poco; }[]; }}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number[]} */
    intArray;
    /** @type {number[]} */
    intList;
    /** @type {string[]} */
    stringArray;
    /** @type {string[]} */
    stringList;
    /** @type {number[]} */
    floatArray;
    /** @type {number[]} */
    doubleList;
    /** @type {string} */
    byteArray;
    /** @type {string[]} */
    charArray;
    /** @type {number[]} */
    decimalList;
    /** @type {Poco[]} */
    pocoArray;
    /** @type {Poco[]} */
    pocoList;
    /** @type {{ [index: string]: Poco[]; }} */
    pocoLookup;
    /** @type {{ [index: string]: { [index:string]: Poco; }[]; }} */
    pocoLookupMap;
}

JavaScript AllCollectionTypes DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/AllCollectionTypes HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsv
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
				}
			}
		]
	}
}
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
				}
			}
		]
	}
}