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

BindQuery usage with required params #41

Closed
joprice opened this issue Dec 27, 2024 · 3 comments
Closed

BindQuery usage with required params #41

joprice opened this issue Dec 27, 2024 · 3 comments
Labels
question Further information is requested

Comments

@joprice
Copy link

joprice commented Dec 27, 2024

Is there a way to get CLIMutable to treat a field as required? I currently get default values such as 0 for int, and null for string. It would be useful for validation to have that handled by the data definition without runtime errors, if possible.

@Lanayx
Copy link
Owner

Lanayx commented Dec 28, 2024

Hi! Have you seen the validation documentation?. It should work for string. For int you might want use this SO answer.

@Lanayx Lanayx added the question Further information is requested label Dec 28, 2024
@joprice
Copy link
Author

joprice commented Dec 28, 2024

Oh wow don't know how I overlooked that. I'm also using some "newtype" single element DU wrappers I need to test with those attributes. For now, I created a newtonsoft jobject from the query and parsed it as json using Thoth, which gives me type-based parsing control, but if I can get away with something simpler I'll switch to that.

@Lanayx
Copy link
Owner

Lanayx commented Dec 28, 2024

Right, the recent validation feature was added specifically with that in mind - to give a simple instrument familiar to many .NET developer allowing quick implementations, while also not preventing to do FP-style validations further on if needed.

@joprice joprice closed this as completed Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants