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

Allow customizing hint in required #172

Merged
merged 2 commits into from
Nov 17, 2024
Merged

Conversation

dhoepelman
Copy link
Collaborator

@dhoepelman dhoepelman commented Nov 16, 2024

Fixes #36

Th syntax is (also seen in README is)

Class:prop required {
  hint = "..."
}

this was not my preferred syntax, but it was one of the only viable ones.

Alternative 2:

Class:prop required(hint = "...") { }

is not valid kotlin syntax, infix functions cannot have extra parameters

Alternative 3:

Class:prop required { } hint("...")

would require changing the return type of these validationbuilder from Unit to something else, most likely Validation, and adding hint to ever validation, which I don't want. I couldn't think of a good alternative for returning.

@dhoepelman dhoepelman merged commit ae36b18 into main Nov 17, 2024
2 checks passed
@dhoepelman dhoepelman deleted the dhoepelman/required-hint branch November 17, 2024 20:37
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.

Allow putting hints on empty required block
1 participant