Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type conversion of model #2259

Open
Natsumeaiovo opened this issue Oct 23, 2024 · 1 comment
Open

Type conversion of model #2259

Natsumeaiovo opened this issue Oct 23, 2024 · 1 comment
Assignees

Comments

@Natsumeaiovo
Copy link

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;
};
@mrlubos
Copy link
Collaborator

mrlubos commented Oct 23, 2024

Hi @Natsumeaiovo, please see the README in this repository. If you'd like to open an issue, you're welcome to do so in Hey API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants