Skip to content

Type conversion of model #2259

Open
Open
@Natsumeaiovo

Description

@Natsumeaiovo

Describe the bug
The backend parameters are of type Long, while the API generated by OpenAPI is of type number. Reading Long type data and converting it to number type may result in accuracy loss. How to map Long type to string or bigint type when generating API in OpenAPI?

backend:

public class Question implements Serializable {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    private Date createTime;

    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}

Code generated using OpenAPI:

export type Question = {
    createTime?: string;
    id?: number;
    isDelete?: number;
    updateTime?: string;
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions