79328041

Date: 2025-01-04 01:28:31
Score: 2
Natty:
Report link

I will try to partly speak about the topic.

We have faced a similar question, when using different versions of an Open Api interface.

The main question was:

Does having a common business logic for the different api versions make sense?

And, if the business logics of the different versions are very similar, in order not to duplicate code, we are considering the option of using a library that generates code (super-models, which are a super-set of all model versions).

This is only possible if all model pojos are compatible in the different versions.

If so, the idea, is to translate the particular model request into a super-model request, which would be the suitable pojo for running your business logic.

And then, when you have a super-model answer, you will have to translate it into the particular model answer, before being converted eventually into json by Jersey (or whatever library you use)

I want to share with you the library I programmed to try to solve the problem (it is at a very early stage, but its unit tests work).

If you try it and have problems, you can contact me at ([email protected])

A link to the library:

github

Shared at my own server

Reasons:
  • Blacklisted phrase (0.5): contact me
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Francisco Javier Rojas