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

[FEATURE]对于给定的复杂类型的json,可以去掉value中字符串的前后空格 #353

Closed
xhhcyh opened this issue May 26, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@xhhcyh
Copy link

xhhcyh commented May 26, 2022

请描述您的需求或者改进建议

对于给定的json字符串,去掉其前后空格。比如:
{ "aNumber": 0, "aString": " string " }
=> { "aNumber": 0, "aString": "string" }

给定的json中内容没有规律,可能是复杂的json字符串:
{ "a": 0, "b": "0", "c": [...], "d": {...}, "e":[{...}], "f": {[...]} }

请描述你建议的实现方案

类似议题:Java – Can Jackson be configured to trim leading/trailing whitespace from all string properties
https://itecnote.com/tecnote/java-can-jackson-be-configured-to-trim-leading-trailing-whitespace-from-all-string-properties/

描述您考虑过的替代方案

暂无

附加信息

暂无

@xhhcyh xhhcyh added the enhancement New feature or request label May 26, 2022
@timnick-snow
Copy link

you can use ValueFilter

@wenshao wenshao added this to the 2.0.5 milestone May 26, 2022
@wenshao
Copy link
Member

wenshao commented May 28, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.5
问题已修复,请用新版本

@wenshao wenshao closed this as completed May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants