my backend should offer two different APIs - different access to the same models , respectively, to the same implementation and to the same database comparisons. Models are sent as JSON, and they are also used by the backend in the same way.
But each API requires different JSON representations. FE I would like to name several fields differently (w / @ JsonProperty fe) or want to omit some.
As already mentioned, they must be consumed by the controllers in the same way as they are created.
Since only the view is different: is there a simple and harsh way to accomplish this?
Example:
Call
ProductsController.java
sym/products/1
must return
{
"id": 1,
"title": "stuff",
"label": "junk"
}
and challenge
ProductsController.java
frontend/products/1
must return
{
"id": 1,
"label": "junk",
"description": "oxmox",
"even-more": "text"
}
Thank you so much!
Tim