jsonix-schema-compiler: Problems with generating enumLeafs

I’m using this schema file ` <?xml version=“1.0” encoding=“UTF-8”?> <xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns=“http://foo.bar.EnumLeafSchema” targetNamespace=“http://foo.bar.EnumLeafSchema” elementFormDefault=“qualified”>

<xsd:element name=“UsesEnumLeaf”> <xsd:complexType> <xsd:sequence> <xsd:element name=“personTitle” type=“PersonTitleCodesEnumeration”></xsd:element> <xsd:element name=“personName” type=“xsd:string”></xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>

<xsd:simpleType name=“PersonTitleCodesEnumeration”> <xsd:restriction base=“xsd:string”> <xsd:enumeration value=“mr” /> <xsd:enumeration value=“ms” /> <xsd:enumeration value=“mrs” /> <xsd:enumeration value=“miss” /> <xsd:enumeration value=“dr” /> </xsd:restriction> </xsd:simpleType>

</xsd:schema> `

This is generated by the compiler:

var enumleafschema_bar_foo_Module_Factory = function () {
  var enumleafschema_bar_foo = {
    name: 'enumleafschema_bar_foo',
    defaultElementNamespaceURI: 'http:\/\/foo.bar.EnumLeafSchema',
    typeInfos: [{
        localName: 'UsesEnumLeaf',
        typeName: null,
        propertyInfos: [{
            name: 'personTitle',
            required: true
          }, {
            name: 'personName',
            required: true
          }]
      }, {
        type: 'enumInfo',
        localName: 'PersonTitleCodesEnumeration',
        values: ['mr', 'ms', 'mrs', 'miss', 'dr']
      }],
    elementInfos: [{
        elementName: 'UsesEnumLeaf',
        typeInfo: '.UsesEnumLeaf'
      }]
  };
  return {
    enumleafschema_bar_foo: enumleafschema_bar_foo
  };
};

But I expected:

localName: 'UsesEnumLeaf',
        typeName: null,
        propertyInfos: [{
            name: 'personTitle',
            required: true,
//This was missing in the generated mapping
            typeInfo: '.PersonTitleCodesEnumeration'
          }, {
            name: 'personName',
            required: true
          }]

Is this a bug? My failure?

Kind regards,

Tom

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Coming this week. There’s one small problem to be solved with hierarchican allOfs.