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

Refactor easyjson with encoding/json #579

Open
Ja7ad opened this issue Sep 28, 2024 · 2 comments · May be fixed by #582
Open

Refactor easyjson with encoding/json #579

Ja7ad opened this issue Sep 28, 2024 · 2 comments · May be fixed by #582
Assignees
Labels
enhancement New feature or request

Comments

@Ja7ad
Copy link
Collaborator

Ja7ad commented Sep 28, 2024

Description
We propose removing easyjson and refactoring the SDK to use the built-in encoding/json package. Although easyjson provides performance benefits, it has limitations when dealing with dynamic types, such as interface{} in search results. This was highlighted in #436, where large numeric values encountered precision issues. Switching to encoding/json would improve flexibility, maintainability, and error handling.

Basic example

// Replace easyjson.Marshal with json.Marshal
json.Marshal(data)
@Ja7ad Ja7ad added the enhancement New feature or request label Sep 28, 2024
@Ja7ad Ja7ad self-assigned this Sep 28, 2024
@Ja7ad Ja7ad changed the title Refactor encoding/json with easyjson Refactor easyjson with encoding/json Sep 28, 2024
@Ja7ad
Copy link
Collaborator Author

Ja7ad commented Oct 2, 2024

Hits field with type *[]map[string]json.RawMessage and unmarshaled value fixed without write custom marshaler.

Screenshot from 2024-10-02 15-41-55
Screenshot from 2024-10-02 15-42-12
Screenshot from 2024-10-02 15-42-25

@Ja7ad
Copy link
Collaborator Author

Ja7ad commented Oct 2, 2024

easyjson make complex client for unmarshaling.

@Ja7ad Ja7ad linked a pull request Oct 9, 2024 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

1 participant