问题
How can I make changes to an XML Schema for a REST interface without impacting consuming applications (if they do not upgrade)?
回答1:
- Just don't alter the existing schema and structures to ensure backward compatibility.
- Only add optional elements and attributes as required to extend the functionality.
- 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
- Add optional elements or attributes.
- Change requiredness from required to optional.
- Add values to enumerations.
Cannot do
- Add or delete required elements or attributes.
- Change element or attribute names.
- Change requiredness from optional to required.
- Remove values from enumerations.
来源:https://stackoverflow.com/questions/30198785/what-backward-compatible-xsd-changes-can-be-made