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

feat: support more loose type-casting #294

Merged
merged 7 commits into from Sep 8, 2022
Merged

feat: support more loose type-casting #294

merged 7 commits into from Sep 8, 2022

Conversation

AsterDY
Copy link
Collaborator

@AsterDY AsterDY commented Sep 7, 2022

BC

  • For better compatibility with other json query lib like jsoniter.Any or gjson.Result, sonic.ast.Node should support more loose type-casting. Now the behavior matrix is as below:
  json-iterator sonic gjson
json.Number
String<>Int
String<>float
String<>Bool string->bool is different withstrconv.ParseBool
Bool<>Int
Bool<>float
Int<>float
map/slice(to interface)
map/slice(to node)
time RFC3339

@AsterDY AsterDY marked this pull request as draft September 7, 2022 04:31
@AsterDY AsterDY marked this pull request as ready for review September 7, 2022 13:20
Copy link
Collaborator

@liuq19 liuq19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AsterDY AsterDY merged commit 2138136 into main Sep 8, 2022
@AsterDY AsterDY deleted the feat/ast_compat branch September 8, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants