You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gonfique produces a struct type for dicts, it also implements .Range methods on dicts when values share same schema/type. While current behavior still preserves the convenience of using maps on iteration/looping over the dict, it still has a problem of leading to unnecessary commit history for usecases where schemas/keys frequently change.
Proposed behavior
Providing a way for user to let specify the dict which its type is desired to be defined based on map[string]any rather than structs. This, way the produced type will be iterable and more importantly its type will stay up-to-date longer, as map types don't contain name of the keys.
Interface
Without suggesting as the final interface, this might give an idea of user interaction on specifying dicts desired to be defined based on maps.
a:
struct: dynamic
a:
b: ...c: ...d: ...
Complication concern
While the implementation of such features is trivial, the complications that may emerge from using this option with combination to other existing features should be investigated before making the call.
Current behavior
Gonfique produces a struct type for dicts, it also implements
.Range
methods on dicts when values share same schema/type. While current behavior still preserves the convenience of usingmap
s on iteration/looping over the dict, it still has a problem of leading to unnecessary commit history for usecases where schemas/keys frequently change.Proposed behavior
Providing a way for user to let specify the dict which its type is desired to be defined based on
map[string]any
rather thanstruct
s. This, way the produced type will be iterable and more importantly its type will stay up-to-date longer, as map types don't contain name of the keys.Interface
Without suggesting as the final interface, this might give an idea of user interaction on specifying dicts desired to be defined based on maps.
Complication concern
While the implementation of such features is trivial, the complications that may emerge from using this option with combination to other existing features should be investigated before making the call.
Related links
A feature request to json2go solution regarding to dynamic keys
The text was updated successfully, but these errors were encountered: