You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/07/18 17:57:04 UTC

[jira] [Commented] (CXF-5887) Enum issue for REST requests

    [ https://issues.apache.org/jira/browse/CXF-5887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066463#comment-14066463 ] 

Sergey Beryozkin commented on CXF-5887:
---------------------------------------

This is a duplicate of https://issues.apache.org/jira/browse/CXF-5722.
It will work for you with CXF 3.0.0, in earlier versions you need to register param converters.

Cheers, Sergey

> 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
>              Labels: cxf, enum, jaxb, rest, wadl
>
> 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)