Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Fully Compatible
-
ALL
-
QE 2023-10-02, QE 2023-10-16, QE 2023-10-30, QE 2023-11-13
-
120
Description
While working on PM-412 I stumbled on the issue of serializing custom defined types in arrays.
Imagine the following idl definition:
types:
|
IndexHint:
|
description: "" |
cpp_type: "stdx::variant<IndexKeyPattern, IndexName, CollScanHint>" |
bson_serialization_type: any
|
serializer: "::mongo::index_hint::append" |
deserializer: "::mongo::index_hint::parse" |
|
|
structs:
|
IndexHintSpec:
|
description: "" |
fields:
|
ns:
|
type: Namespace
|
optional: true |
allowedIndexes:
|
type: array<IndexHint>
|
During compilation of this idl module, the following error appears:
build/ninja/mongo/db/query/query_settings_gen.cpp:262:18: error: no member named 'append' in 'mpark::variant<mongo::BSONObj, std::basic_string<char>, mongo::CollScanHint>' |
item.append(&arrayBuilder);
|
~~~~ ^
|
This happens because IDL generator can not serialize custom types correctly in the array.
Attachments
Issue Links
- related to
-
SERVER-81959 IDL: unambiguously distinguish between member and nonmember function names with leading dot
-
- Needs Scheduling
-