Test

<back to all web services

HelloWithEnumList

import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    public static class HelloWithEnumList
    {
        public ArrayList<EnumType> enumProp = null;
        public ArrayList<EnumWithValues> enumWithValues = null;
        public ArrayList<EnumType> nullableEnumProp = null;
        public ArrayList<EnumFlags> enumFlags = null;
        public ArrayList<EnumStyle> enumStyle = null;
        
        public ArrayList<EnumType> getEnumProp() { return enumProp; }
        public HelloWithEnumList setEnumProp(ArrayList<EnumType> value) { this.enumProp = value; return this; }
        public ArrayList<EnumWithValues> getEnumWithValues() { return enumWithValues; }
        public HelloWithEnumList setEnumWithValues(ArrayList<EnumWithValues> value) { this.enumWithValues = value; return this; }
        public ArrayList<EnumType> getNullableEnumProp() { return nullableEnumProp; }
        public HelloWithEnumList setNullableEnumProp(ArrayList<EnumType> value) { this.nullableEnumProp = value; return this; }
        public ArrayList<EnumFlags> getEnumFlags() { return enumFlags; }
        public HelloWithEnumList setEnumFlags(ArrayList<EnumFlags> value) { this.enumFlags = value; return this; }
        public ArrayList<EnumStyle> getEnumStyle() { return enumStyle; }
        public HelloWithEnumList setEnumStyle(ArrayList<EnumStyle> value) { this.enumStyle = value; return this; }
    }

    public static enum EnumType
    {
        Value1,
        Value2,
        Value3;
    }

    public static enum EnumWithValues
    {
        None,
        Value1,
        Value2;
    }

    @Flags()
    public static enum EnumFlags
    {
        @SerializedName("0") Value0(0),
        @SerializedName("1") Value1(1),
        @SerializedName("2") Value2(2),
        @SerializedName("4") Value3(4),
        @SerializedName("7") Value123(7);

        private final int value;
        EnumFlags(final int intValue) { value = intValue; }
        public int getValue() { return value; }
    }

    public static enum EnumStyle
    {
        Lower,
        Upper,
        PascalCase,
        CamelCase,
        CamelUPPER,
        PascalUPPER;
    }

}

Java 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
	]
}