{"id":13509733,"url":"https://github.com/zbarnes757/jeaux","last_synced_at":"2025-12-11T23:47:07.052Z","repository":{"id":57509060,"uuid":"65420849","full_name":"zbarnes757/jeaux","owner":"zbarnes757","description":"A module for validating http params and queries","archived":false,"fork":false,"pushed_at":"2020-03-03T19:09:17.000Z","size":26,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-11T04:45:39.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/jeaux","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbarnes757.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-10T22:33:17.000Z","updated_at":"2024-06-22T04:10:54.000Z","dependencies_parsed_at":"2022-08-29T20:00:42.097Z","dependency_job_id":null,"html_url":"https://github.com/zbarnes757/jeaux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zbarnes757/jeaux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbarnes757%2Fjeaux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbarnes757%2Fjeaux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbarnes757%2Fjeaux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbarnes757%2Fjeaux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbarnes757","download_url":"https://codeload.github.com/zbarnes757/jeaux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbarnes757%2Fjeaux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280289144,"owners_count":26305269,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T02:01:12.118Z","updated_at":"2025-10-21T15:37:22.054Z","avatar_url":"https://github.com/zbarnes757.png","language":"Elixir","funding_links":[],"categories":["Validations"],"sub_categories":[],"readme":"# Jeaux\n\n[![Hex.pm](https://img.shields.io/hexpm/v/jeaux.svg)](https://hex.pm/packages/jeaux)\n[![Build Status](https://travis-ci.org/zbarnes757/jeaux.svg?branch=master)](https://travis-ci.org/zbarnes757/jeaux)\n\nJeaux is a light and easy schema validator.\n\n## Installation\n\n[Available in Hex](https://hex.pm/packages/jeaux), the package can be installed as:\n\n  1. Add `jeaux` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [{:jeaux, \"~\u003e 0.7.0\"}]\n    end\n    ```\n\nExample:\n\n```elixir\n# web/controllers/my_controller.ex\n@params_schema %{\n  lat!: :float,\n  lon!: :float,\n  radius: [type: :integer, default: 100, min: 1, max: 100],\n  is_point: :boolean,\n  properties: %{\n    name: :string\n  }\n}\n\ndef index(conn, params) do\n    case Jeaux.validate(params, @params_schema) do\n      {:ok, valid_params} -\u003e do_your_thing(valid_params)\n      {:error, message} -\u003e Explode.bad_request(conn, message)\n    end\nend\n```\n\nUsing a `!` in your key denotes it is required.\n\nCurrently, the following keys are valid:\n* `type:` with `:integer`, `:string`, `:boolean`, `:guid` (`:string` type is implied), `:float`, or `:list` as applicable types\n* `default:` Sets a default value if none is currently provided in params\n* `min:` Minimum value a param can have\n* `max:` Maximum value a param can have\n* `valid:` Values that are valid options. Can be a single item or a list.\n\nFor `:list` types, if passed an array from a query string (a la `foo=1,2,3`), it will parse into a list (`['1', '2', '3']`). I am still working on finding a way to coerce these into the types they should be.\n\nParams must be a map but the keys can be strings or atoms and in camelCase or snake_case. The keys of the object to be validated will be converted to snake_case prior to validation. Therefore the validation should use snake_case atoms.  Additionally, the result will always be returned as snake_case atom keys as well.\n\nIf you want to contribute, feel free to fork and open a pr.\n\nCheckout [Explode](https://github.com/pkinney/explode) for an easy utility for responding with standard HTTP/JSON error payloads in Plug- and Phoenix-based applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbarnes757%2Fjeaux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbarnes757%2Fjeaux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbarnes757%2Fjeaux/lists"}