That is not possible. See the JAX-RS specification:
3.3.2.1 Entity Parameters
The value of a parameter not annotated with
@FormParam
or any of the annotations listed in in Section 3.2, called the entity parameter, is mapped from the request entity body. Conversion between an entity body and a Java type is the responsibility of an entity provider, see Section 4.2. Resource methods MUST have at most one entity parameter.
There can be only one method 'entity parameter'.
What you ask for would not be RESTful. REST ist not RPC (Remote Procedure Call), you don't 'pass' objects to a 'method'. In REST you transfer Resource representations from and to identifying URLs.
In your example the Resource would be an EmployeeInfo
wrapping Employee
and Manager
.
Besides, /post
is not a very RESTful URL. What Resource is identified by this? What happens if you GET /post
? Please think in REST terms, not in RPC.