title: Generating schema with default minOccurs using MOXy
body: <p>I'm trying to use EclipseLink MOXy 2.1.2 and Java 1.6 to generate a schema based on my domain classes, following this example: <a href="http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JAXB/GenerateSchema" rel="nofollow">http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JAXB/GenerateSchema</a></p>
  
  <p>However there is an issue with the default minOccurs value. If the annotation @XmlElement does not specify the required attribute, it should default to false, which means when generating the schema minOccurs should be 0. This works as expected with Sun's JAXB implementation. However when using Moxy minOccurs is not being generated and the default value of 1 is implied. </p>
  
  <p>For example,</p>
  
  <pre><code>public Integer getDuration() {
     return duration;
  }
  </code></pre>
  
  <p>Should have generated </p>
  
  <pre><code>&lt;xs:element name="duration" type="xsd:int" minOccurs="0"/&gt;
  </code></pre>
  
  <p>Instead if using Moxy it generates</p>
  
  <pre><code>&lt;xsd:element name="duration" type="xsd:int"/&gt;
  </code></pre>
  
  <p>which means minOccurs="1" since that is the default. Is this a bug? Is there any workaround for this?</p>
  
  <p>Thanks in advance!</p>