Test

<back to all web services

HelloWithEnumList

"use strict";
/** @typedef {'Value1'|'Value2'|'Value3'} */
export var EnumType;
(function (EnumType) {
    EnumType["Value1"] = "Value1"
    EnumType["Value2"] = "Value2"
    EnumType["Value3"] = "Value3"
})(EnumType || (EnumType = {}));
/** @typedef {'None'|'Member 1'|'Value2'} */
export var EnumWithValues;
(function (EnumWithValues) {
    EnumWithValues["None"] = "None"
    EnumWithValues["Value1"] = "Member 1"
    EnumWithValues["Value2"] = "Value2"
})(EnumWithValues || (EnumWithValues = {}));
/** @typedef {number} */
export var EnumFlags;
(function (EnumFlags) {
    EnumFlags[EnumFlags["Value0"] = 0] = "Value0"
    EnumFlags[EnumFlags["Value1"] = 1] = "Value1"
    EnumFlags[EnumFlags["Value2"] = 2] = "Value2"
    EnumFlags[EnumFlags["Value3"] = 4] = "Value3"
    EnumFlags[EnumFlags["Value123"] = 7] = "Value123"
})(EnumFlags || (EnumFlags = {}));
/** @typedef {'lower'|'UPPER'|'PascalCase'|'camelCase'|'camelUPPER'|'PascalUPPER'} */
export var EnumStyle;
(function (EnumStyle) {
    EnumStyle["lower"] = "lower"
    EnumStyle["UPPER"] = "UPPER"
    EnumStyle["PascalCase"] = "PascalCase"
    EnumStyle["camelCase"] = "camelCase"
    EnumStyle["camelUPPER"] = "camelUPPER"
    EnumStyle["PascalUPPER"] = "PascalUPPER"
})(EnumStyle || (EnumStyle = {}));
export class HelloWithEnumList {
    /** @param {{enumProp?:EnumType[],enumWithValues?:EnumWithValues[],nullableEnumProp?:EnumType[],enumFlags?:EnumFlags[],enumStyle?:EnumStyle[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {EnumType[]} */
    enumProp;
    /** @type {EnumWithValues[]} */
    enumWithValues;
    /** @type {EnumType[]} */
    nullableEnumProp;
    /** @type {EnumFlags[]} */
    enumFlags;
    /** @type {EnumStyle[]} */
    enumStyle;
}

JavaScript HelloWithEnumList 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/oneway/HelloWithEnumList HTTP/1.1 
Host: test.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	enumProp: 
	[
		Value1
	],
	enumWithValues: 
	[
		None
	],
	nullableEnumProp: 
	[
		Value1
	],
	enumFlags: 
	[
		0
	],
	enumStyle: 
	[
		lower
	]
}