nsip / specgen_input_au

Capture of specgen input files
2 stars 0 forks source link

Inconsistencies in schema between OpenAPI static headers and Infrastructure schema #65

Closed opoudjis closed 1 year ago

opoudjis commented 1 year ago

Now that I am dynamically compiling the infrastructure spec, inconsistencies have become apparent.

Some are minor:

    multipleRequests:         
      deleteMultiSchema:  
        properties:          
        deleteRequest:       
            $ref: 'jsonSchema_OpenAPI3.0_Create_IN.yaml#/definitions/deleteRequestCollection'

...

  deleteRequestCollection:
    type: object
    properties: 
      deleteRequest:
        type: array
        items:
          $ref: '#/definitions/deleteRequest'

That is rectified by correcting $ref: 'jsonSchema_OpenAPI3.0_Create_IN.yaml#/definitions/deleteRequestCollection' to $ref: 'jsonSchema_OpenAPI3.0_Create_IN.yaml#/definitions/deleteRequest in the header.

Which means, @joerghuber, you are going to have to review all the corrections I introduce into the header files. Many of these are now going to be clear errors in OpenAPI 3.1 as well, so I am going to be changing both files (main, all).

In addition, all the lists in the header file examples have to be converted, as I'd already identified in previous weeks, from Goessner-style lists to PESC-style lists. So:

However, some are more grave:

      deleteMultiExamples:    
        pesc:                 
          summary: PESC - Batch Delete Request
          value:
            deleteRequest:
              deletes:
                - delete:
                    id: df789e1c-dfe7-4c18-8ef0-d907b81ea61e
                - delete:
                    id: 41953aaa-2811-11e6-b67b-9e71128cae77
                - delete:
                    id: ff789e1c-dfe7-4c18-8ef0-d907b81ea61e

The now dynamically generated jsonSchema_OpenAPI3.0_Create_IN.yaml is correctly treating the delete requests as a PESC list, so the example should be not the Goessner-style list given above, as I'd already found previously, but:

      deleteMultiExamples:    
        pesc:                 
          summary: PESC - Batch Delete Request
          value:
            deleteRequest:
              deletes:
                delete:
                    - id: df789e1c-dfe7-4c18-8ef0-d907b81ea61e
                    - id: 41953aaa-2811-11e6-b67b-9e71128cae77
                    - id: ff789e1c-dfe7-4c18-8ef0-d907b81ea61e
opoudjis commented 1 year ago

... actually, I'll change the "all" file. I now believe we need to have one master file for main and all, and switch headers in and out.

opoudjis commented 1 year ago

Infrastructure error codes in the spec are integers. In Goessner, they end up as strings; in the PESC payload examples, they need to be integers.

opoudjis commented 1 year ago

deleteResponse wrapper was missing from PESC and Goessner examples of deletion responses (but not missing in XML example)

opoudjis commented 1 year ago

There are no further validation errors in 3.0 with infrastructure