What backward-compatible XSD changes can be made?

风流意气都作罢 提交于 2020-01-02 09:36:05

问题


How can I make changes to an XML Schema for a REST interface without impacting consuming applications (if they do not upgrade)?


回答1:


  1. Just don't alter the existing schema and structures to ensure backward compatibility.
  2. Only add optional elements and attributes as required to extend the functionality.
  3. Always version your services - either URL way or Content-Type way! This is to ensure maintainability.



回答2:


Here are some examples of request XSD changes that you can and cannot do to maintain backward compatibility with the previous interface version.

Can do

  1. Add optional elements or attributes.
  2. Change requiredness from required to optional.
  3. Add values to enumerations.

Cannot do

  1. Add or delete required elements or attributes.
  2. Change element or attribute names.
  3. Change requiredness from optional to required.
  4. Remove values from enumerations.


来源:https://stackoverflow.com/questions/30198785/what-backward-compatible-xsd-changes-can-be-made

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!