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

Add MarshalJSON methods to *Document / *Array #49

Open
AlekSi opened this issue Sep 26, 2024 · 2 comments · Fixed by #71
Open

Add MarshalJSON methods to *Document / *Array #49

AlekSi opened this issue Sep 26, 2024 · 2 comments · Fixed by #71
Labels
code/feature Some user-visible feature is not implemented yet

Comments

@AlekSi
Copy link
Member

AlekSi commented Sep 26, 2024

Blocked by https://jira.mongodb.org/browse/GODRIVER-3476. After that is resolved, we should re-enable fuzzing; see references to this issue.

In some cases, we need JSON representation of Document/Array, not JSON-like like we currently have. For example, extension functions accept BSON or JSON, and logging their parameters in JSON would make it easier to copy and paste them from logs to the psql console.

Let's implement encoding/json.Marshaler on *Document and *Array.
Let's do the basic JSON for now, but document the fact that the exact JSON representation may change. For example, we might use Extended JSON v2 in the future.

@AlekSi AlekSi added the code/feature Some user-visible feature is not implemented yet label Sep 26, 2024
@AlekSi AlekSi changed the title Add MarshalJSON methods Add MarshalJSON methods to *Document / *Array Sep 26, 2024
@AlekSi AlekSi added the good first issue Good issues for new external contributors label Sep 26, 2024
@KrishnaSindhur
Copy link
Contributor

if no one is working on it, I can pick this up!!

@AlekSi
Copy link
Member Author

AlekSi commented Dec 25, 2024

The only thing that is left is to update test cases:

wire/wirebson/bson_test.go

Lines 948 to 952 in e3aefb9

// We should set all tc.j and remove this Skip.
// TODO https://github.com/FerretDB/wire/issues/49
if tc.j == "" {
t.Skip("https://github.com/FerretDB/wire/issues/49")
}

@AlekSi AlekSi removed community Issues and PRs assigned to community members good first issue Good issues for new external contributors labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
Status: No status
2 participants