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

[BUG] JSONWriter.Feature.ReferenceDetection 无效 #2599

Open
Bob6474 opened this issue May 20, 2024 · 1 comment
Open

[BUG] JSONWriter.Feature.ReferenceDetection 无效 #2599

Bob6474 opened this issue May 20, 2024 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@Bob6474
Copy link

Bob6474 commented May 20, 2024

问题描述

简要描述您碰到的问题。
@jsontype(serializeFeatures = {JSONWriter.Feature.ReferenceDetection}) 无效
@JSONField(serializeFeatures = {JSONWriter.Feature.ReferenceDetection}) 无效

环境信息

请填写以下信息:

  • OS信息: macOS 14.4.1
  • JDK信息: java version "17.0.9" 2023-10-17 LTS
  • 版本信息:fastjson2 2.0.50

重现步骤

如何操作可以重现该问题:

@JSONType(serializeFeatures = {JSONWriter.Feature.ReferenceDetection}) 
public class A {
  private B b;
}

@JSONType(serializeFeatures = {JSONWriter.Feature.ReferenceDetection}) 
public class B {
  private A a;
}

JSONObject.toJSONString(a);

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。

相关日志输出

请复制并粘贴任何相关的日志输出。
image

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

@Bob6474 Bob6474 added the bug Something isn't working label May 20, 2024
@wenshao
Copy link
Member

wenshao commented May 22, 2024

ReferenceDetection 目前不支持单个类型或者字段开启哦

@wenshao wenshao added the wontfix This will not be worked on label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants