How to use my DTO class in OpenApi specification

Viewed 262

I have microservices and api. And in the microservice responsible for the api, I want to use OpenApi generator to generate the interfaces that I would refer to in my classes to catch changes in the specification at compile time. For example:

OpenApi spec:

paths: 
/support/ping:
  get:
   tags:
    -ping
   summary: Check
   operationId: ping
   responses:
      '200':
         description: OK
         content:
           text/plain:
             schema:
                type: string

It generate PingApi interfaces, that has method ping, that I can override. And its work good.

public class PingController implements PingApi {...}

But if I want use my own DTO class, that located in another microservice (with another methods that use it), I don't know what I must do. If I rewrite own DTO class in spec, then they will be two different classes and interface cannot be implemented. How can I resolve this problem? Maybe I can linked own class in spec?

0 Answers
Related