Skip to content

Commit

Permalink
@Schema and description not picked up for polymorphic attributes. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bnasslahsen committed Jun 23, 2024
1 parent cd9778f commit fa35308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.swagger.v3.oas.annotations.media.Schema;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(Dog.class),
@JsonSubTypes.Type(Cat.class)
})
@Schema(description = "This is a Pet")
public class Pet {

public final String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"type": "string"
}
},
"description": "This is a Pet",
"discriminator": {
"propertyName": "type"
}
Expand Down

0 comments on commit fa35308

Please sign in to comment.