Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ public class PlatformAndKeywordSanitizer {
public static String fixEnumValue (String enumValue) {
String enumMemberName = enumValue;

// NOT_SET is a special value in C++ SDK enums used in two scenarios:
// 1. When an enum cannot be deserialized from a string value
// 2. When accessing an enum created from an invalid string value
// Note: Services may still use NOT_SET as a valid key in maps
//
// TODO: model this as a crt or std optional to represent "absent of value"
// instead of using a common-ish predetermined value.
if (enumValue.equals("NOT_SET")) {
return "NOT_SET_VALUE";
}

for (String invalid : ENUM_CHARS_MAPPING.keySet()) {
enumMemberName = enumMemberName.replace(invalid, ENUM_CHARS_MAPPING.get(invalid));
}
Expand Down