nsip / specgen_input_au

Capture of specgen input files
2 stars 0 forks source link

Implementation of MR and OR is not compatible with PESC #57

Closed opoudjis closed 1 year ago

opoudjis commented 1 year ago

This has taken me 6 HOURS to work out. I am very VERY angry at the cavalier way PESC has been approached.

I am also angry at Redocly for the cryptic wording of the error required value must be ["array"].

This bug has prevented almost all examples from actually being validated, because quite simply Redocly falls over as soon as a list with MR obligation shows up.

Recall that in PESC, arrays are encoded as { XLIST: X : [ A, B ] }

In the generated schema, if a list has MR obligation, i.e. at least one element, that is converted into JSON Schema as:

  SchoolContactList:
    description: >-
      <p>A list of contact persons associated with a school.</p>
    type: object
    required:
    - "SchoolContact"
    properties:
      SchoolContact:
        type: array
        items:
          $ref: '#/definitions/SchoolContact'

The required statement is an array:

- "SchoolContact"

That is correct in Goessner mode.

stand by

opoudjis commented 1 year ago

INVALID