Common object in two objects java

I am implementing one api and I have the following request bodies for 2 different endpoints:

endpoint1:

 {
  "requests": [
    {
      "id": "123"
    }
  ]
}

endpoint2:

{
  "requests": [
    {
      "variable": "stack"
    }
  ]
}

Is there a way to build a common object for these 2 in java spring application?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum