i have a response model entity ResponseEntity:
RespDTO:
@Getter
@Setter
public class RespDTO implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@Schema(nullable = true)
private Long id;
@Schema(nullable = true)
private String otherId;
@NotNull
private String cod;
@NotNull
private String description;
@Schema(nullable = true)
private OtherDTO object;
@NotNull
private String idTransaction;
}
My problem, in OpenApi doc, is the representation of OtherDTO because:
RespDTO:
required:
- cod
- description
- idTransaction
type: object
properties:
id:
type: integer
format: int64
nullable: true
otherId:
type: string
nullable: true
cod:
type: string
description:
type: string
object:
$ref: '#/components/schemas/OtherDTO'
idTransaction:
type: string
I want to show, in openApi doc, the "nullable" to
object: $ref: '#/components/schemas/OtherDTO'
My wrong test:
- Annotation @Schema with nullable true
- Annotation @Nullable
- i have manipulated the io.swagger.v3.oas.models.OpenAPI with automatic required false when the property name is object
Every test is wrong.
Please help me :)
Thank to all