mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-09-22 12:04:33 -07:00
Options: have as_dict return set values as lists to reduce JSON footprint (#2354)
* Options: return set values as lists to reduce JSON footprint * sorted() Co-authored-by: black-sliver <[email protected]> --------- Co-authored-by: black-sliver <[email protected]>
This commit is contained in:
co-authored by
black-sliver
parent
78a4b01db5
commit
90c5f45a1f
+4
-1
@@ -950,7 +950,10 @@ class CommonOptions(metaclass=OptionsMetaProperty):
|
||||
else:
|
||||
raise ValueError(f"{casing} is invalid casing for as_dict. "
|
||||
"Valid names are 'snake', 'camel', 'pascal', 'kebab'.")
|
||||
option_results[display_name] = getattr(self, option_name).value
|
||||
value = getattr(self, option_name).value
|
||||
if isinstance(value, set):
|
||||
value = sorted(value)
|
||||
option_results[display_name] = value
|
||||
else:
|
||||
raise ValueError(f"{option_name} not found in {tuple(type(self).type_hints)}")
|
||||
return option_results
|
||||
|
||||
Reference in New Issue
Block a user