cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinay Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-5887) Enum issue for REST requests
Date Thu, 17 Jul 2014 12:45:05 GMT
Vinay Kumar created CXF-5887:
--------------------------------

             Summary: Enum issue for REST requests
                 Key: CXF-5887
                 URL: https://issues.apache.org/jira/browse/CXF-5887
             Project: CXF
          Issue Type: Bug
         Environment: CXF Version: 2.7.4
JDK - build 1.7.0_40-b43
            Reporter: Vinay Kumar


I am not sure weather its bug or I am doing something wrong. Basically I am creating REST
API with Enum as one of the QueryParam. The Enum class is generated from xsd :

Enum in xsd:
<xsd:simpleType name="CodeEnum">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="One" />
			<xsd:enumeration value="Two" />
			<xsd:enumeration value="Hello World" />			
		</xsd:restriction>
	</xsd:simpleType>

Jaxb class for Enum has variables ONE("One"), TWO("Two"), HELLO_WORLD("Hello World")

REST API: getCode(@QueryParam("code") CodeEnum code);

CXF Generated WADL content for API is : 

<resource path="getCode">
<method name="GET">
<request>
<param name="code" style="query" type="xs:string">
<option value="ONE"/>
<option value="TWO"/><option value="HELLO_WORLD"/>
</param></request>

Here What I observed in wadl is options values are Enum names I would expect Enum values..

If above wadl option is selected . CXF server throws IllegalArgumentException since it could
not find ONE.

Is it bug or is there any work around to solve this issue

Thanks in advance.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message