Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

JSONField 1.x 升级到2.x 命名规则失效 #4528

Open

Description

@QQQJoker
@JSONField(name = "companyName")
private String companyName;

   SerializeConfig config = new SerializeConfig();
    config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
    config.put(User.class, new CustomSerializer());
    User user = new User();
    user.setCompanyName("123");
    Object json = JSON.toJSON(user,config);
    System.out.println("json = " + json);

定义了全局使用下划线,个别字段使用驼峰,2.x不生效 1.x版本是生效的

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions