How to use your own classes in the Swagger Codegen file

Viewed 30

Suppose I have a Spring boot app, with DTOs and controllers that accept them.
And I want to generate documentation using a swagger yaml file. This file will look something like this:

paths:
    /someDto/createSomeDto:
        post:
            summary: Creates a new someDto
            operationId: createSomeDto
            parameters:
                - name: someDto
                  in: body
                  description: data transfer object
                  schema:
                      type: object
                      required:
                          - counterId
                          - value
                      properties:
                          id:
                              type: string
                              maxLength: 10
                          count:
                              type: integer
                              format: int32
            responses:
                '200':
                    some response...

But I don't want to create a someDto class, because I already have it in the program. Moreover, my someDto class has a lot of validation, which cannot be achieved using the swagger codegen. The question is: how to indicate that I use my own class as a parameter?
Why is there no special import keyword?

0 Answers
Related