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 a method to JsonSink to allow separate writing of key and value #97

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

Tillerino
Copy link
Contributor

@Tillerino Tillerino commented Apr 17, 2024

Solves #89

I added a key method to JsonSink - instead of just adding it to JsonWriterBase. This escalated a tiny bit since I then had to implement the method in JsonBuilder as well, which did not yet have its own test - being covered by the JsonWriterTest, I presume.

Although JsonWriterBase could immediately write the key to the underlying stream, I also implemented the feature in the "pending key" style, since it will then read very similarly in both JsonWriterBase and JsonBuilder.

It's not quite clear to me what fields in JSON objects are called, but from the tests/error messages in the library, I picked up that you're calling them "key" :)

Copy link
Owner

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

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

Great! Thanks for the contribution.

@mmastrac mmastrac merged commit 8db90a8 into mmastrac:master Apr 17, 2024
1 check passed
@mmastrac
Copy link
Owner

Released as 1.9. It's been a bit of time since I pushed to Maven Central so please check it out if you can.

Happy to accept PRs to modernize the build infrastructure as well.

@Tillerino Tillerino deleted the separate-key-value branch April 17, 2024 15:10
@Tillerino
Copy link
Contributor Author

Yes it's all there. Thanks for the quick release!

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.

2 participants