Quick revision
The short answer
Only adding an optional response field is backward compatible, and only for clients that ignore fields they do not know. Renaming a field, changing a number to a string and making an optional request field required all break existing clients. A new enum value breaks clients that map enums strictly, so the contract should say that clients must tolerate unknown values.
What to remember
In this answer, we saw that compatibility is decided by the old client, not by the server. Adding an optional response field is safe for tolerant readers, and Spring Boot's ObjectMapper is tolerant because it disables FAIL_ON_UNKNOWN_PROPERTIES, but other clients may not be. Renaming a field, changing its type and making a request field required all break clients, a new enum value breaks strict enum mapping unless the contract says enums may grow, and a change in meaning is breaking even when the schema does not change.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Only adding an optional response field is backward compatible, and only for clients that ignore fields they do not know. Renaming a field, changing a number to a string and making an optional request field required all break existing clients. A new enum value breaks clients that map enums strictly, so the contract should say that clients must tolerate unknown values.
Why this question is asked
Every API changes, and most production incidents caused by an API change come from a change its author believed was harmless. Interviewers ask this question because the answer depends on how clients read JSON, not on how the server writes it, and because the Java defaults are not the same in every library. In this answer, we will define backward compatibility, then go through each of the five changes with code that shows what an existing client experiences, look at changes in meaning that no schema check can see, and finish with a summary table.
1What Backward Compatible Means
A change is backward compatible when clients written against the old version keep working against the new one without being changed or redeployed. The old client is the one that matters: it was compiled, tested and shipped months ago, and it will keep sending and reading exactly what it did then.
So for each change we ask two questions. For responses: can an old client still read what the server now sends? For requests: does the server still accept what an old client sends? A pattern called tolerant reader makes many changes safe: the reader takes only the fields it needs and ignores everything else.
2Adding a Field to the Response
Suppose the order response gains a field called currency. An old client has a class without that field. Whether it breaks depends on how its JSON library treats unknown properties.
Notice that the same JSON works with one mapper and fails with the other. Jackson enables DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES by default, but Spring Boot's auto-configured ObjectMapper disables it, so Spring clients that use the injected mapper or RestClient tolerate new fields. A client that creates its own ObjectMapper, or one written in another language with a strict decoder, may not. Jackson 3 changed several defaults, so check your version.
So adding a field is compatible only when the contract tells clients to ignore unknown fields and the known clients actually do. That is why the field should also be optional for clients: an old client never relies on it.
3Renaming a Field or Changing Its Type
Renaming total to amount is the same, for an old client, as removing total and adding amount. The old client finds no total and reads its default.
The rename is the dangerous kind of break, because nothing fails: the client silently shows a total of zero. The type change is subtler than it looks. Jackson coerces the string "1250" into a long by default, so a Java client might keep working for a while, until a value like "12.50" arrives. A JavaScript client would not fail either; it would just start concatenating strings instead of adding numbers. Both changes are breaking.
4Adding a New Enum Value
Adding SHIPPED_PARTIALLY to an order status enum looks additive, and on the server it is. But many clients map the value to a Java enum, and the old enum has no such constant.
So a new enum value breaks every client that maps enums strictly. The fix is partly technical and partly a contract rule: the API documentation must say that enums may grow and clients must handle unknown values, and client code should map them to an UNKNOWN constant or keep the raw string. Once that rule is published and followed, adding values becomes a compatible change.
5Making an Optional Request Field Required
This one is about requests, so the direction flips: the server is now the reader. An old client never sends the new required field, because it did not exist or was optional when the client was written.
Every request from an old client is now rejected. The reverse change, making a required request field optional, is compatible, because old clients send it anyway. For requests the rule mirrors the one for responses: the server may accept more, but must never demand more.
6Changes in Meaning Without a Schema Change
Some breaking changes do not touch the schema at all. If total used to be in euros and now holds cents, every client still parses it perfectly and every invoice is wrong by a factor of 100. The same applies to a timestamp that moves from local time to UTC, a field that used to be the net price and is now the gross price, or a list that used to be sorted and no longer is. No diff tool catches these, so they must be reviewed as breaking changes and handled like a rename: add a new field with the new meaning, and leave the old one alone.
| Change | Compatible? | Why |
|---|---|---|
| Add an optional response field | Yes, for tolerant readers | Strict decoders fail on unknown fields |
| Rename a response field | No | Old clients read a missing field, often silently |
| Number becomes a string | No | Parsers fail or JavaScript concatenates |
| New enum value | Only if clients tolerate it | Strict enum mapping throws |
| Optional request field becomes required | No | Old requests now get 400 |
| Same field, new meaning or unit | No | Parses fine, values are wrong |
7Follow-up questions
How would you rename a field without breaking clients?
We do it in steps instead of one change. First we add the new field next to the old one and fill both in every response; on input we accept either name, which Jackson can do with @JsonAlias on the new property. Then we mark the old field as deprecated in the OpenAPI spec, tell consumers, and measure who still reads or sends it. Only when that usage reaches zero, or a published sunset date passes, do we remove the old field. This pattern is called expand and contract.
Is removing a response field ever compatible?
Only if no client reads it, which we can rarely prove without usage data or contract tests. Treat removal as breaking by default and go through deprecation first.
Should the server reject unknown fields in requests?
Usually not. If the server is strict, a client that is newer than the server, for example during a rolling deploy or a rollback, gets errors for fields the server does not know yet. Being tolerant on both sides keeps mixed versions working.
8Conclusion
In this answer, we saw that compatibility is decided by the old client, not by the server. Adding an optional response field is safe for tolerant readers, and Spring Boot's ObjectMapper is tolerant because it disables FAIL_ON_UNKNOWN_PROPERTIES, but other clients may not be. Renaming a field, changing its type and making a request field required all break clients, a new enum value breaks strict enum mapping unless the contract says enums may grow, and a change in meaning is breaking even when the schema does not change.
Open with
Of those five, only adding an optional response field is backward compatible, and only for clients that ignore unknown fields. Spring Boot's ObjectMapper disables FAIL_ON_UNKNOWN_PROPERTIES, so Spring clients are fine, but a plain new ObjectMapper or a strict client in another language would fail, so I would check the real consumers.
Then, if they want more
Renaming a field is breaking, and it is nasty because old clients usually just read a missing value as null or zero without any error. Changing a number to a string is breaking; Jackson may even coerce it for a while, so it fails later on a value like 12.50, and JavaScript would start concatenating.
A new enum value breaks any client that maps enums strictly, so I put in the contract that enums can grow and ask clients to map unknown values to an UNKNOWN default, for example with @JsonEnumDefaultValue. Making an optional request field required breaks every old client that does not send it, because they now get 400.
And I would add one more category: a change in meaning, such as an amount that switches from euros to cents. The schema is identical and every value is wrong, so I treat that as breaking too.
For a rename I use expand and contract: add the new field, serve both, deprecate the old one, measure usage, and remove it only when nobody uses it.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Spring Web MVC
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Which of these changes to a JSON response are backward compatible for existing clients...": https://scrivio-interview-library.netlify.app/spring-boot/rest-api-design/24b3fce47b/