-
-
Notifications
You must be signed in to change notification settings - Fork 535
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
I've run into a problem trying to reuse the same DTO under different OpenAPI schemas. When I have this hierarchy:
@Data
public class Company {
@Schema(description = "name of the company")
private String name;
}
@Data
public class Contract {
@Schema(description = "unique id")
private String id;
@Schema(description = "client company")
private Company client;
@Schema(description = "partner company")
private Company partner;
}}
then Company schema will only be exported once under the name "partner company" in the yml file. This means that the field "client" will have the description "partner company", which makes no sense in this case. I tried giving each field a different name in the Schema annotation, but it seems to be on purpose that you can rewrite a class' schema this way. Why is that?
I'd really like a solution to this problem, because I can't give the client a document with errors like this.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested