I'm using OpenApi v3.3.4
(formerly called Swagger CodeGen
) maven plugin to generate my rest controller via api.yml
files where I describe all the operations I want to expose.
In my use case, I want to expose a method POST: handleNotification(@RequestBody SignatureNotification notification)
which its request body's type is generated via another maven-plugin in /targer
folder.
Actually I'm defining SignatureNotification
in Components
part of my .yml file:
...
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SignatureNotification'
...
Which gets generated by OpenApi plugin and then I map it to SignatureNotification
that already exists and has the same attributes.
I'm not very satisfied with this solution so I want to know if there is a way to tell OpenApi Generator to use an external object as a reference?
.yml
file we need to defineSignatureNotification
in components area having astype: object
– Landy