Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation metadata setting max count = 2 to elements with no maxOccurs. #135

Open
fell-lucas opened this issue May 6, 2021 · 0 comments

Comments

@fell-lucas
Copy link

fell-lucas commented May 6, 2021

Hello, I have the following structure in my XSD schema:

<xs:element name="Docentes">
  <xs:complexType>
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="Docente">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Nome" type="TNome"/>
            <xs:element name="Titulacao" type="TTitulacao"/>
          </xs:sequence>
         </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>

When generating validation metadata, this is the related yml file generated:

docentes:
            -
                NotNull:
                    groups:
                        - xsd_rules
            -
                Count:
                    min: 1
                    max: 2
                    groups:
                        - xsd_rules
            -
                Valid: null

Even though the sequence inside the parent element has an "unbounded" maxOccurs, the validator returns the following violation: (in this case, there are 4 elements, and it's complaining because it thinks it should only contain 2 max.)

image

Removing "max" from count in the generated yaml file fixes the issue.

Count:
  min: 1
  groups:
    - xsd_rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant