{"id":22031752,"url":"https://github.com/lixhq/validex","last_synced_at":"2025-05-07T12:22:45.552Z","repository":{"id":62430682,"uuid":"89221884","full_name":"lixhq/validex","owner":"lixhq","description":"Validex is a library for doing data validation in Elixir.","archived":false,"fork":false,"pushed_at":"2019-06-06T12:28:35.000Z","size":57,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T10:01:35.734Z","etag":null,"topics":["elixir","type-checking","validation"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/validex","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lixhq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-24T09:27:15.000Z","updated_at":"2025-01-22T00:02:25.000Z","dependencies_parsed_at":"2022-11-01T20:19:57.512Z","dependency_job_id":null,"html_url":"https://github.com/lixhq/validex","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixhq%2Fvalidex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixhq%2Fvalidex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixhq%2Fvalidex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixhq%2Fvalidex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lixhq","download_url":"https://codeload.github.com/lixhq/validex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874434,"owners_count":21817822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","type-checking","validation"],"created_at":"2024-11-30T08:20:08.355Z","updated_at":"2025-05-07T12:22:45.531Z","avatar_url":"https://github.com/lixhq.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validex [![Build Status](https://travis-ci.org/lixhq/validex.svg?branch=master)](https://travis-ci.org/lixhq/validex) [![Coverage Status](https://coveralls.io/repos/github/lixhq/validex/badge.svg?branch=master)](https://coveralls.io/github/lixhq/validex?branch=master) [![Inline docs](http://inch-ci.org/github/lixhq/validex.svg?branch=master\u0026style=shields)](http://inch-ci.org/github/lixhq/validex)\n\nValidex is a library for doing data validation in Elixir. \n\nAt [Lix](https://www.lix.com) we use it to ensure all data entering our domain is fully validated. One goal of Validex is to make schema definitions easy to read and write using intuitive syntax.\n\nValidex is easily extendable and allow you to specify custom validators by implementing the [Validex.Validator](https://hexdocs.pm/validex/Validex.Validator.html) behaviour. Another extensionpoint is custom [Validex.RuleExpander](https://hexdocs.pm/validex/Validex.RuleExpander.html), that allow for rewriting the schema in order to have custom shorthands for a larger schema. One example of this can be seen [here](https://github.com/lixhq/validex/blob/master/test/support/rule_expanders.ex#L16-L23).\n\n## Installation\n\nThe package can be installed by adding `validex` \nto your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:validex, \"~\u003e 0.1\"}]\nend\n```\n\n## Usage\n\n```elixir\nschema = [name: :string, age: :integer, sex: :atom]\ndata = %{ name: \"Simon\", age: :ripe }\n\nfalse = Validex.valid?(data, schema)\n\n[\n  {:error, :age, :type, \"age should be integer but was atom\" },\n  {:error, :sex, :presence, \"sex is a required attribute but was absent\"}\n] = Validex.errors(data, schema)\n```\n\n## Documentation\n\nDocumentation can be found at [https://hexdocs.pm/validex](https://hexdocs.pm/validex).\n\n## Prior art\n\n- [PropTypex](https://github.com/lixhq/proptypex) which were the previous library we wrote for doing data validation.\n- [Vex](https://github.com/CargoSense/vex) A now abandoned validation library by the people behind [Absinthe](http://absinthe-graphql.org/).\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixhq%2Fvalidex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flixhq%2Fvalidex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixhq%2Fvalidex/lists"}