Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16400

Fix constraints registration on sub sub list item property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.1
    • Fix Version/s: 7.2
    • Component/s: Core
    • Tags:
    • Impact type:
      Configuration Change
    • Upgrade notes:
      Hide

      Constraints can de added to XSD list item by defining a simpleType and associated restrictions.

      Show
      Constraints can de added to XSD list item by defining a simpleType and associated restrictions.
    • Sprint:
      Sprint io 7.2-1
    • Story Points:
      0

      Description

      When constraints are set on a sub sub list item, the field registration fails when parsed by XSD loader.

      Assuming following definition is ok:

        <!--  list of lists use case -->
      
        <xs:element name="listOfLists" type="nxs:vlistOfListsType" />
      
        <xs:complexType name="vlistOfListsType">
          <xs:sequence>
            <xs:element name="listOfListsItem" type="nxs:vlistOfListsItemType"
              minOccurs="0" maxOccurs="unbounded" />
          </xs:sequence>
        </xs:complexType>
      
        <xs:complexType name="vlistOfListsItemType">
          <xs:sequence>
            <xs:element name="stringItem" type="xs:string" />
            <xs:element name="stringListItem" type="nxs:vstringList" />
          </xs:sequence>
        </xs:complexType>
      
        <xs:simpleType name="restrictedType">
          <xs:restriction base="xs:string">
            <xs:pattern value="[A-Z][a-z '-]+" />
          </xs:restriction>
        </xs:simpleType>
      
        <xs:simpleType name="vstringList">
          <xs:list itemType="nxs:restrictedType" />
        </xs:simpleType>
      

      The following error appears in logs:

      main 14:04:01,043 ERROR [XSDLoader] list item type was not defined -> you should define first the item type
      main 14:04:01,044 WARN  [XSDLoader] loadType for stringListItem of vstringList simple type returns null
      

      See non-regression test (ignored for now) TestSchemaLoaderRestriction#testListOfListRestriction

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: