Followup to the "API Version Testing" epic, and to SERVER-55899. There are circumstances in which the "optionalBool" IDL type is preferable to the "bool" type with optional: true, for example in basic_types.idl:
types: optionalBool: bson_serialization_type: any cpp_type: "mongo::OptionalBool" default: "mongo::OptionalBool()" deserializer: "mongo::OptionalBool::parseFromBSON" serializer: "mongo::OptionalBool::serializeToBSON" structs: Collation: fields: backwards: type: optionalBool
The bson_serialization_type for optionalBool is "any" in IDL, which disables a lot of idl_check_compatibility.py's semantic checks.
Consider promoting optionalBool from a custom-defined IDL type to a first-class IDL type with well-known semantics, and update idl_check_compatibility.py to understand this type as well as it understands the "bool" type with optional: true.
This work can be done after the Versioned API is released in 5.0. Past IDL definitions should still be valid and our backward compatibility rules will still apply, we'll just start interpreting IDL files differently when we check them.
- is related to
-
SERVER-60349 Make IDL compatibility checker allow addition of fields with type 'optionalBool'
- Closed
- related to
-
SERVER-55899 Move away from using Bson_serialization_type “any” - Collation
- Closed