v1: server_api (CXX-3237, CXX-3238) #1539
Open
+489
−51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves CXX-3237 and CXX-3238 for the
v1::server_apicomponent.mongoc_server_api_tis not used as the underlying implementation due to the inability to convertv1::server_api::version(scoped enum: underlying type isint) tomongoc_server_api_version_t(unscoped enum: underlying type is "a suitably sized integer type"). Because "invalid API version" exceptions are only thrown upon request to convert to/from a string or by themake_server_apihelper (only when required by client/pool ctors), validating this narrowing conversion with an exception would be a breaking change. Therefore, thev1::server_apifields continue to be handled independently by mongocxx rather than converted into mongoc values.Because
v1::server_api::versionis completely equivalent tov_noabi::options::server_api::version, the latter is defined as an alias of the former (similar tov1::return_document). This avoids the need for v_noabi <-> v1 enumeration conversions.