cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nataliya Wierts (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4948) CXF does not validate unions
Date Mon, 08 Apr 2013 07:51:16 GMT

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

Nataliya Wierts commented on CXF-4948:
--------------------------------------

Let me know if you have here what you are looking for!

Just as info. It is impossible (it is validated and rejected in this case) to send 

 <industry>
 <pricetype>
    <item>rentandbuy</item>
    <item>trash</item>
</pricetype>
</industry>

It will be recognized that "trash" does not work. But a value outside union is allowed, although
it should be rejected too, same as "trash"
                
> CXF does not validate unions
> ----------------------------
>
>                 Key: CXF-4948
>                 URL: https://issues.apache.org/jira/browse/CXF-4948
>             Project: CXF
>          Issue Type: Bug
>         Environment: any, Linux or Windows
>            Reporter: Nataliya Wierts
>
> If user has small simpletype entities, that are used as building blocks in xsd:
> {code}
>  <xs:simpleType name="rentpersqm">
>         <xs:restriction base="xs:string">
>             <xs:enumeration value="rentpersqm">
>                 <xs:annotation>
>                     <xs:documentation xml:lang="en">rent per sq meter</xs:documentation>
>                     <xs:documentation xml:lang="de-DE">Miete pro Quadratmeter</xs:documentation>
>                 </xs:annotation>
>             </xs:enumeration>
>         </xs:restriction>
>     </xs:simpleType>
>     <xs:simpleType name="rentpermonth">
>         <xs:restriction base="xs:string">
>             <xs:enumeration value="rentpermonth">
>                 <xs:annotation>
>                     <xs:documentation xml:lang="en">rent per month</xs:documentation>
>                     <xs:documentation xml:lang="de-DE">Miete pro Monat</xs:documentation>
>                 </xs:annotation>
>             </xs:enumeration>
>         </xs:restriction>
>     </xs:simpleType>
>     <xs:simpleType name="rentandbuy">
>         <xs:restriction base="xs:string">
>             <xs:enumeration value="rentandbuy">
>                 <xs:annotation>
>                     <xs:documentation xml:lang="en">rent and buy</xs:documentation>
>                     <xs:documentation xml:lang="de-DE">Kauf oder Miete</xs:documentation>
>                 </xs:annotation>
>             </xs:enumeration>
>         </xs:restriction>
>     </xs:simpleType>
>    
>  {code}   
> than in union the validation does not check that blocks contain this string
> {code}
>    <xs:simpleType name="TradeSitePriceType">
>         <xs:restriction>
>             <xs:simpleType>
>                 <xs:union memberTypes="rentpermonth rentandbuy"/>
>             </xs:simpleType>
>         </xs:restriction>
>     </xs:simpleType>
>     <xs:simpleType name="CommercialPriceType">
>         <xs:restriction>
>             <xs:simpleType>
>                 <xs:union memberTypes="rentpersqm rentpermonth"/>
>             </xs:simpleType>
>         </xs:restriction>
>     </xs:simpleType>
>   .......
>   <xs:complexType name="industry">
>   ....
>     <xs:element name="pricetype" type="priceTypes:CommercialPriceType" minOccurs="0"
maxOccurs="1"/>
>   ....
>   </xs:complexType>
> ......
> {code}
> the validation for CommercialPriceType should not let 'rent', but it does, it is not
considered to be an error at all. And all values are transfered into String while transforming
of xsd entities to Java Classes.
> it would go without problems:
> {code}
>  <industry>
>  <pricetype>
>     <item>rentandbuy</item>
>     <item>rentpermonth</item>
> </pricetype>
> </industry>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message