I am working on an endpoint implementation that wraps multiple endpoints.
There is an endpoint /entity1
implemented in a dependency with its own openapi spec generated in maven plugin to a certain package. And there is an endpoint /entity2
which comes from another dependency.
I am trying to generate a spec for /batch
gets an array of entity1 and an array of entity2, like this schema:
paths:
/batch:
post:
description: Batch ingest data
operationId: batchCreate
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Batch'
description: ...
components:
schemas:
Batch:
type: object
properties:
entity1list:
type: array
items:
type: object
entity2list:
type: array
items:
type: object
I currently have the model generated with java plain Object
.
Questions:
- Is it possible to point the openapi to a different spec loaded in a different package? That would be ideal. Keep in mind I can't import the spec and regenerate the code since it won't do it on different packages.
- If not, can I convert the plain Object to
Entity1
/Entity2
?