goetas / xsd2php

Convert XSD into PHP classes and serialize into XML (deserialize too)
149 stars 62 forks source link

NotNull problem #133

Open augustoalvess opened 2 years ago

augustoalvess commented 2 years ago

How to resolve lost of NotNull validations? Tipo, Numero and Data elements are losting NotNull.

Old xsd: `

Ato regulatório de reconhecimento `

Old yml validation file: `

App\Models\DiplomaDigital\V103\TAtoRegulatorioComOuSemEMECType: properties: tipo:

            Choice:
                choices:
                    - Parecer
                    - Resolução
                    - Decreto
                    - Portaria
                    - 'Lei Federal'
                    - 'Lei Estadual'
                    - 'Lei Municipal'
                    - 'Ato Próprio'
                groups:
                    - xsd_rules
        -
            NotNull:
                groups:
                    - xsd_rules
    numero:
        -
            Regex:
                pattern: '~^((S/N)|((\d)[-\d\w/]*))$~'
                groups:
                    - xsd_rules
        -
            NotNull:
                groups:
                    - xsd_rules
    data:
        -
            NotNull:
                groups:
                    - xsd_rules
    veiculoPublicacao:
        -
            Regex:
                pattern: '~^([!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1})$~'
                groups:
                    - xsd_rules
    informacoesTramitacaoEMEC:
        -
            Valid: null

`

New xsd: `

Ato regulatório de reconhecimento `

New yml validation file: `

App\Models\DiplomaDigital\V1041\TAtoRegulatorioComOuSemEMECType: properties: informacoesTramitacaoEMEC:

            Valid: null
    tipo:
        -
            Choice:
                choices:
                    - Parecer
                    - Resolução
                    - Decreto
                    - Portaria
                    - Deliberação
                    - 'Lei Federal'
                    - 'Lei Estadual'
                    - 'Lei Municipal'
                    - 'Ato Próprio'
                groups:
                    - xsd_rules
    numero:
        -
            Regex:
                pattern: '~^((S/N)|((\d)[-\d\w_/]*))$~'
                groups:
                    - xsd_rules
    veiculoPublicacao:
        -
            Regex:
                pattern: '~^([!-ÿ]{1}[ -ÿ]{0,}[!-ÿ]{1}|[!-ÿ]{1})$~'
                groups:
                    - xsd_rules

`