Skip to content

[BUG]无法解析 $ref: @ #2671

@raychow

Description

@raychow

问题描述

fastjson2 2.0.51

final var str = "{\"context\":{\"$ref\":\"@\"}}";
JSON.parseObject(str, Map.class);

报错:

Exception in thread "main" com.alibaba.fastjson2.JSONException: reference path invalid : @
at com.alibaba.fastjson2.JSONReader.handleResolveTasks(JSONReader.java:311)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:866)

在 fastjson1 中, 可以被解析为 {"context":{"context":...}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions