Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a SetDefaults function #283

Draft
wants to merge 1 commit into
base: feature/implement-subschemas
Choose a base branch
from

Conversation

ptodev
Copy link

@ptodev ptodev commented Sep 19, 2024

A SetDefaults() function would set the structure fields to their default values. It could be particularly useful for users of mapstructure.

We could also have a Validate() function? I could try to add it if we agree on how a SetDefaults() could be implemented, since I suppose the implementation would be similar.

This branch doesn't depend on subschemas, but I set the merge target to omissis:feature/implement-subschemas because I've been using subschemas for another project, and my changes happened to depend on refactoring being done on the subschema branch :)

@ptodev ptodev changed the base branch from main to feature/implement-subschemas September 19, 2024 17:38
@omissis
Copy link
Owner

omissis commented Nov 3, 2024

This is an interesting idea, and it will probably benefit from #293's work as well. given the dependency on the subschemas branch, I would probably try to focus on merging that one first, and then come back here.
Unfortunately that branch is a bit behind main now, and I have been reluctant to merge that work because I want to take the time to test it properly. Is there any chance you can help with that? Even just providing some schemas I can base my tests on (if they are OSS) would do, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants