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
Problem
When generating a schema, it would be beneficial to have the capability to set default values using an instance of the struct that is being converted into a schema.
Currently, this is challenging because the name specified in the struct tags may not correspond to the actual name of the struct field in the code, which makes it difficult to match the fields using their names.
Proposed Solution
To resolve this, we could include the original name of the struct field—unmodified by struct tags—in the schema. This would preserve the ability to match the fields based on their original names in the code, facilitating the setting of default values.
Alternatives Considered
An alternative method I have considered involves replacing the field name of the instantiated object with the name specified in the tag and using that for matching. However, this approach does not fully address the problem, as the name from the tag might be altered by a function like KeyNamer.
The text was updated successfully, but these errors were encountered:
Friendly ping; any thoughts about this? We need this functionality in lazygit, so we're currently forking to add it, but it would be nice if we didn't have to do that.
Feature Request
Problem
When generating a schema, it would be beneficial to have the capability to set default values using an instance of the struct that is being converted into a schema.
Currently, this is challenging because the name specified in the struct tags may not correspond to the actual name of the struct field in the code, which makes it difficult to match the fields using their names.
Proposed Solution
To resolve this, we could include the original name of the struct field—unmodified by struct tags—in the schema. This would preserve the ability to match the fields based on their original names in the code, facilitating the setting of default values.
Alternatives Considered
An alternative method I have considered involves replacing the field name of the instantiated object with the name specified in the tag and using that for matching. However, this approach does not fully address the problem, as the name from the tag might be altered by a function like
KeyNamer
.The text was updated successfully, but these errors were encountered: