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

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

Open
opoudjis opened this issue Dec 19, 2022 · 4 comments
Open

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

opoudjis opened this issue Dec 19, 2022 · 4 comments
Assignees

Comments

@opoudjis
Copy link
Member

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
Copy link
Member Author

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

@opoudjis opoudjis mentioned this issue Dec 21, 2022
@joerghuber
Copy link
Collaborator

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
Copy link
Collaborator

4pins commented Mar 13, 2023

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

@opoudjis
Copy link
Member Author

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.

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

3 participants