nsip / specgen_input_au

Capture of specgen input files
2 stars 0 forks source link

Distinct treatment of lists in XML as well as Goessner #56

Open opoudjis opened 1 year ago

opoudjis commented 1 year ago

XML examples have lists as

<XList><X>A</X><X>B</X></XList>

That is consistent with Goessner, but it is inconsistent with PESC, which is what the object schemas are in:

{ XList: { X : [A, B] } }

As a result, XML examples with lists do not validate, now that PESC examples with lists do.

The resolution is increasingly looking to be that we cannot apply a single schema, no matter how clever, to all of XML, PESC, and Goessner: the schema for each payload notation needs to be different.

opoudjis commented 1 year ago

There are a few validation issues with XML (14) over and above this issue.

joerghuber commented 1 year ago

This is an interesting and I believe an impossible fix because of the ambiguity for lists in XML and Goessner. If a list only contains one element it will appear in Goessner as a element. When the list contains more than one element it will appear in Goessner as an array. This ambiguity is one of the main reasons for the introduction of a schema aware JSON such as PESC.

4pins commented 1 year ago

I agree with Joerg's statement above. Furthermore I think Goessner belongs on our list of blemishes along with Matrix Parameters.

opoudjis commented 1 year ago

Goessner has had its day, sure. If this extends to XML and not just Goessner... then we can't publish or validate XML in OpenAPI. That may be the conclusion, but we need to make sure that it is the outcome. You can make all lists map to a union of list or singleton in the XML JSON-Schema. Although yes, it will be hideous.