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: Move and test unmarshalMapToStruct(data map[string]interface{}, outStruct interface{}) #106

Open
2 tasks done
phughk opened this issue Oct 18, 2023 · 2 comments · May be fixed by #114
Open
2 tasks done
Assignees

Comments

@phughk
Copy link
Contributor

phughk commented Oct 18, 2023

Is your feature request related to a problem?

A lot of the deserialisation is happening via JSON, even for code that is already deserialised.
There is a non-json marshaller, unmarshalMapToStruct(data map[string]interface{}, outStruct interface{}), in gorilla.go.
It should be moved to a separate package (not protocol implementation related, not API related) and tested.

Describe the solution

Move the function unmarshalMapToStruct(data map[string]interface{}, outStruct interface{}) into a separate package.
Test the funciton independently of protocol implementations.

Alternative methods

There could already be code that does this. It's important that we don't rely on translating map[string]interface{} into json and back into a golang struct though.

SurrealDB version

1.0.0

Contact Details

pratim.bhosale@surrealdb.com hugh@surrealdb.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ElecTwix
Copy link
Contributor

Hi @phughk ,
I can take this if it is still available.

@phughk
Copy link
Contributor Author

phughk commented Oct 18, 2023

Amazing thank you @ElecTwix !

@ElecTwix ElecTwix linked a pull request Nov 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants