0

I'm trying to use Spring doc api, to generate the open api document for my service project.

I have a common class Response class defined in another library and we don't have access to add/modify this class.

for e.g.

public class RestResponse implements Serializable {
    protected MetadataType metadata;
    protected List any;
    ......

}

This class will be used in multiple services (multiple projects) to generate the response, 'any' field in the RestResponse class is populated with the individual services business object.

How can i model the response class for each individual service using @Schema.

Thanks in advance.

Helen
  • 87,344
  • 17
  • 243
  • 314
mattkv
  • 1

1 Answers1

0

You can have a look at the answer: For the Ability to define different schemas for the same class

Your question is not related directly to springdoc, but to swagger usage.

brianbro
  • 4,141
  • 2
  • 24
  • 37