-
Notifications
You must be signed in to change notification settings - Fork 496
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]JSON解析bug #1417
Comments
问题找到了,但是toJSONString的json是这个格式,为啥读取的时候报错呢"authorities":Set[{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_ADMIN"}] |
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.32-SNAPSHOT/ |
已验证,没问题了 |
环境信息
请填写以下信息:
重现步骤
期待的正确结果
期望序列化为@type中的对象
相关日志输出
Exception in thread "main" com.alibaba.fastjson2.JSONException: illegal input S, offset 629, character S, line 1, column 630, fastjson-version 2.0.29 {"@type":"java.util.Collections$UnmodifiableMap","java.security.Principal":{"@type":"org.springframework.security.authentication.UsernamePasswordAuthenticationToken","authenticated":true,"authorities":[{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_ADMIN"}],"details":{"@type":"org.springframework.security.web.authentication.WebAuthenticationDetails","remoteAddress":"127.0.0.1","sessionId":"38220AEDC251E5CE7F45344BCA805C89"},"name":"user","principal":{"@type":"org.springframework.security.core.userdetails.User","accountNonExpired":true,"accountNonLocked":true,"authorities":Set[{"@type":"org.springframework.security.core.authority.SimpleGrantedAuthority","authority":"ROLE_ADMIN"}],"credentialsNonExpired":true,"enabled":true,"username":"user"}},"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest":{"@type":"org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest","additionalParameters":{"@type":"java.util.Collections$UnmodifiableMap"},"attributes":{"@type":"java.util.Collections$UnmodifiableMap"},"authorizationRequestUri":"http://127.0.0.1:9000/oauth2/authorize?response_type=code&client_id=messaging-client&scope=message.read&redirect_uri=http://127.0.0.1:8000/login/oauth2/code/messaging-client-oidc","authorizationUri":"http://127.0.0.1:9000/oauth2/authorize","clientId":"messaging-client","grantType":{"value":"authorization_code"},"redirectUri":"http://127.0.0.1:8000/login/oauth2/code/messaging-client-oidc","responseType":{"value":"code"},"scopes":Set["message.read"]},"state":"Ahvv87vejITg_FgjAtcGUKMw_G_aZIS1fbdD_mcgXFg="}
at com.alibaba.fastjson2.JSONReader.readObject(JSONReader.java:1799)
at com.alibaba.fastjson2.JSONReader.readObject(JSONReader.java:1771)
at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:1598)
at com.alibaba.fastjson2.reader.ObjectReaderImplMap.readObject(ObjectReaderImplMap.java:380)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:686)
at org.example.web.ServerController.main(ServerController.java:87)
The text was updated successfully, but these errors were encountered: