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

Add validate #225

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Add validate #225

merged 2 commits into from
Mar 7, 2024

Conversation

Axot017
Copy link
Contributor

@Axot017 Axot017 commented Jan 18, 2024

Hello!

I would like to add library that i recently published on opam. It is a PPX deriver that generates function for validating given type based on attributes.

Here is example usage

type test_record = {
  min : string; [@min_length 2]
  max : string; [@max_length 5]
  numeric_list : (int [@less_than 10]) list; [@min_length 2] 
}
[@@deriving validate]

let example_record = { min = "ab"; max = "hello"; numeric_list = [1, 2, 3] }
let validation_result = validate_test_record example_record

Repo: https://github.com/Axot017/validate

@rizo
Copy link
Member

rizo commented Mar 7, 2024

Apologies for the delay. Thanks for adding this!

@rizo rizo merged commit f6d2dd2 into ocaml-community:master Mar 7, 2024
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