-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
XML Object - unfortunate default rule for name changes #2096
Comments
@hrennau , I agree, it's not a great design decision. Where I don't think we can do this in a v3.x version, because it would be a breaking change. We can consider it for v4, but it may also depend on whether the TSC wants to continue evolving XML Object, or adopt a more comprehensive approach like Alternative Schemas. |
I agree that this can't be done in 3.x. Feel free to start a discussion about XML in the OAI/sig-moonwalk repository, and see: for discussions in the context of alternative schemas. |
In the OpenAPI spec, section "XML Object",
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#xmlObject
the examples show a default rule which I think is a bad decision.
Consider the case (see also spec example at the end of this text):
So we an array type with a wrapped XML representation, a wrapper name explicitly set, and an item name not explicitly set.
Proposal
In this case the item name should correspond to the property name, it should not be changed to the wrapper name.
Rationale
Almost certainly one wants wrapper name and item name to be different; it should suffice to manipulate one of the two to achieve this goal. To let the name change of the wrapper be "inherited" by the items makes no sense at all.
Status quo, however ...
See below for the spec example, demonstrating undesirable behavior.
Schema:
XML
The text was updated successfully, but these errors were encountered: