Quick revision
The short answer
I would define the wire contract first, independent of any library: ISO 8601 dates with an offset, a rule for null fields, enum casing, how money is represented, and tolerance of unknown fields on input. Then I would pick one provider per platform for support reasons, but enforce the contract with tests, by shipping a shared module with a configured ContextResolver and a JSON compatibility test kit that every service runs. The rollout goes service by service behind contract tests and consumer checks, because changing a provider is a breaking change for clients, and exceptions are tracked in an API catalog with deadlines and written into the OpenAPI style guide.
What to remember
In this answer, we saw that the fix for inconsistent JSON across 60 services is a written wire contract covering dates, nulls, enums, money and unknown fields, met by one supported provider with shared configuration and proven by a compatibility test kit. Because a format change breaks loose clients, each service moves deliberately, with tolerant input first, consumer checks and versioning where needed, while exceptions are tracked with owners and deadlines and the rules live in the OpenAPI style guide.
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.
I would define the wire contract first, independent of any library: ISO 8601 dates with an offset, a rule for null fields, enum casing, how money is represented, and tolerance of unknown fields on input. Then I would pick one provider per platform for support reasons, but enforce the contract with tests, by shipping a shared module with a configured ContextResolver and a JSON compatibility test kit that every service runs. The rollout goes service by service behind contract tests and consumer checks, because changing a provider is a breaking change for clients, and exceptions are tracked in an API catalog with deadlines and written into the OpenAPI style guide.
Why this question is asked
Inconsistent JSON looks like a small annoyance, but across 60 services it means every client writes special parsing code, bugs hide in date and money conversions, and simple changes become risky. Interviewers ask this leadership question to see whether we can set a technical standard, get many teams to adopt it, and avoid breaking clients while doing so. In this answer, we will see why the library is not the standard, write the wire contract, choose a provider and package the configuration, build a test kit, plan the rollout safely, and manage the exceptions.
1Why the Library Is Not the Standard
It is tempting to say "everyone uses Jackson" and call it done. But the differences clients see, such as whether null fields appear, how dates look and how enums are spelled, come from configuration, not from the library name. Two Jackson services with different ObjectMapper settings differ as much as a Jackson service and a JSON-B one. And a library choice says nothing about money precision or unknown-field tolerance.
So the standard is a description of the JSON on the wire, the contract clients rely on. The library and its configuration are just how each service meets it, and tests are how we know it does.
2Writing the Wire Contract
The contract fits on one page. Each rule removes a class of client bugs, and each needs a short reason so teams accept it.
| Topic | Rule | Reason |
|---|---|---|
| Timestamps | ISO 8601 with offset: 2026-03-01T10:00:00Z | Unambiguous across time zones |
| Dates | ISO 8601 date: 2026-03-01 | No time zone confusion |
| Null fields | Omitted from responses | Smaller bodies, one rule for clients |
| Enums | UPPER_SNAKE_CASE strings | Stable, readable, no ordinals |
| Money | Decimal string plus currency: "120.50", "EUR" | No floating point rounding |
| Unknown input fields | Ignored | Clients and servers evolve independently |
| Field names | camelCase | Matches most client languages |
3One Provider, One Shared Configuration
For support reasons, I would pick one JSON provider per platform, for example Jackson for all JAX-RS services, because the platform team can then patch one library, answer questions about one set of features and keep one configuration. But the choice is secondary: if a team has good reasons to stay on JSON-B for a while, it can still meet the contract, and the tests will prove it.
The platform team ships a small shared module, for example company-json-jaxrs, that contains a ContextResolver<ObjectMapper> configured to the contract and a feature class that registers it. Services add the dependency and register one class. Spring MVC services in the same company get the equivalent configuration through a Jackson2ObjectMapperBuilderCustomizer or the Jackson 3 equivalent in Spring Boot 4, so clients see the same JSON regardless of framework.
4A Compatibility Test Kit Every Service Runs
The test kit is what turns the standard from a document into a fact. It is a test library with sample DTOs covering each rule, golden JSON files showing the expected output, and an abstract test class that each service extends. The test serialises the samples through the service's actual configured provider and compares them with the golden files, and it posts bodies with unknown fields and expects them to be accepted. A service's own DTOs can be added with one line each.
Because the kit tests behaviour rather than imports, it also catches a service that registered the shared module but overrides one setting somewhere else, which is exactly the kind of drift we are trying to stop.
5Rolling It Out Without Breaking Clients
Changing the JSON of a running service is a breaking change for any client that parses loosely or depends on the old shape. A mobile app that reads dates as arrays will fail when they become strings. So we roll out per service, in a deliberate way. First we find the consumers, using the API catalog, gateway logs and consumer-driven contract tests if teams have them. Then we make input tolerant first, which is safe, and change output only when consumers are ready.
For output changes with external or slow-moving consumers, we version: the new format is served on a new API version or behind a media type parameter, and the old one is retired on a published date. Internal consumers can often move in the same sprint, checked by their own contract tests.
- Run the test kit, list differencesDates, nulls, enums, money
- Identify consumersCatalog, gateway logs, contract tests
- Make input tolerantSafe for every client
- Output change breaks a consumer?YesNew API version with retirement dateNoSwitch output, consumers verified
- Register shared module, kit passesService marked compliant in the catalog
5 steps in order. Play them, or step through them one at a time.
6Managing Exceptions and Measuring Progress
Some services cannot move quickly, for example one whose main client is a partner that releases twice a year. They get a recorded exception in the API catalog, with an owner, the reason and a deadline, rather than a quiet permanent difference. The standard itself is published in the OpenAPI style guide, and lint rules in the API review check new specifications, for example that date fields use format date-time.
We report the number of services passing the kit out of 60, and the open exceptions with their dates. A realistic target is new services compliant from day one, internal-only services within one or two quarters, and the externally consumed ones on the timeline their consumers allow.
7Follow-up questions
Why omit nulls rather than always include them?
Either rule works if it is consistent. Omitting nulls keeps bodies small and avoids clients treating null and missing differently. Some teams prefer explicit nulls for clarity; the important part is that every service does the same and the test kit checks it.
How do you get 60 teams to adopt it?
Make the right thing the easy thing: a shared module that is one dependency and one registration, a test kit that tells each team exactly what differs, help from the platform team for the tricky migrations, and a visible compliance list. Mandates without tooling rarely work.
What about services that are not Java?
The contract and the golden files are language-neutral, so a Node or Go service can run the same samples through its own serializer and compare against the same expected JSON.
8Conclusion
In this answer, we saw that the fix for inconsistent JSON across 60 services is a written wire contract covering dates, nulls, enums, money and unknown fields, met by one supported provider with shared configuration and proven by a compatibility test kit. Because a format change breaks loose clients, each service moves deliberately, with tolerant input first, consumer checks and versioning where needed, while exceptions are tracked with owners and deadlines and the rules live in the OpenAPI style guide.
Open with
I would start by writing the wire contract, not by picking a library, because what clients see comes from configuration. The contract covers timestamps in ISO 8601 with an offset, plain ISO dates, whether nulls are omitted or present, enum spelling such as upper snake case, money as a decimal string with a currency so there is no floating point rounding, camelCase names, and unknown fields ignored on input.
Then, if they want more
Then I would choose one provider per platform, probably Jackson, so the platform team supports one library, but I would enforce the contract with tests, not with the library choice.
The platform team ships a shared module with a configured ContextResolver of ObjectMapper and the equivalent customiser for Spring MVC services, plus a JSON compatibility test kit: sample DTOs and golden files that every service runs through its actual configuration. The rollout has to be careful, because changing output is a breaking change for any client that parses loosely.
Per service, I would run the kit, find the consumers through the catalog and gateway logs, make input tolerant first, and change output only when consumers are verified, using a new API version where external clients cannot move quickly. Services that cannot comply yet get a recorded exception with an owner and a deadline.
I would publish the standard in the OpenAPI style guide with lint rules and report how many of the 60 services pass the kit.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Spring Boot 4
- 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
- Jakarta EE specifications
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 "Your company runs 60 JAX-RS services, half with Jackson and half with JSON-B, and...": https://scrivio-interview-library.netlify.app/java/jax-rs/7552d9201a/