Skip to content

CDRIVER-4659 Add extended json output capability for bson_array_as_json #1305

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

Merged
merged 7 commits into from
Jun 15, 2023

Conversation

joshbsiegel
Copy link
Contributor

@joshbsiegel joshbsiegel commented Jun 13, 2023

  • Added functions to bson_array_as_json to mimic the functionality of bson_as_json and allow for legacy, relaxed, and canonical json output
  • Added a new option to bson_json_opts_t to specify if the BSON is an outermost array
  • Added a function to set this new option as we cannot change the bson_json_opts_t initializer
  • Included necessary additional tests
  • Tested in conjunction with CXX-1712 Overload to_json to correctly handle bson arrays mongo-cxx-driver#976

@joshbsiegel joshbsiegel requested a review from kevinAlbs June 13, 2023 19:14
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Nicely done. Code changes look good. Please add documentation for the new API.

@kevinAlbs kevinAlbs requested a review from eramongodb June 14, 2023 15:03
Copy link
Contributor

@eramongodb eramongodb left a comment

Choose a reason for hiding this comment

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

LGTM with pending fixes to is_outermost_array initialization and whitespacing in bson_json_opts_t.rst.

@joshbsiegel joshbsiegel requested a review from kevinAlbs June 14, 2023 19:59
@joshbsiegel joshbsiegel requested a review from kevinAlbs June 14, 2023 20:36
@joshbsiegel joshbsiegel merged commit a41683b into mongodb:master Jun 15, 2023
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.

3 participants