yotor_coder

yotor_coder

ExJoi – Declarative Validation for Elixir

ExJoi v0.9.0 - Async Validation & Parallel Processing

Just released ExJoi v0.9.0 with async validation support! Now you can validate with external services, database lookups, and long-running computations—all running in parallel using Task.async_stream.

What’s New

  • Async validators with ExJoi.async/3 for external service checks

  • Parallel processing - multiple async fields validate simultaneously

  • Timeout control - configurable timeouts per rule or globally

  • Array element validation - validate array items in parallel

Quick Example

schema = ExJoi.schema(%{
  username: ExJoi.async(
    ExJoi.string(required: true, min: 3),
    fn value, _ctx ->
      Task.async(fn ->
        if UsernameService.available?(value) do
          {:ok, value}
        else
          {:error, [%{code: :username_taken, message: "username is already taken"}]}
        end
      end)
    end,
    timeout: 3000
  )
})

# Multiple async fields run in parallel automatically
ExJoi.validate(data, schema, max_concurrency: 5)


Next Plan: Meta Programming & Schema Compiler

The next version of ExJoi will focus on high-performance validation:

  • Pre-compiled schemas for faster runtime execution

  • Macro DSL for declarative and efficient schema definitions

  • Pattern-matching based validation for speed

  • Schema caching with ETS

  • Additional performance optimizations

This will make ExJoi faster and more scalable, especially for large or complex validation scenarios.

Call for Collaborators

If you’re interested in Elixir, meta programming, or performance optimizations, I’d love your help building this next phase! Contributions, ideas, and experiments are very welcome.

Resources

Check out the full documentation for real-world examples, error handling, and best practices!

Where Next?

Popular in Announcing Top

kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
395 12072 119
New
simagyari
Hi Everyone, I’d like to share my first open-source package and my first Elixir project, GeoMeasure. It enables one to calculate propert...
New
Zurga
Subscribe to events emitted by EctoWatch, and cache the changed row. Use the sync/3 function to update an in-memory row or list of rows u...
New
jechol
I’m excited to share FeistelCipher and AshFeistelCipher, PostgreSQL-based libraries that provide encrypted integer IDs using the Feistel ...
New
mikehostetler
LLM DB - LLM Model Metadata Package This package was extracted out of the ReqLLM project. LLM DB is a model metadata catalog with fast, ...
New
tugayac
Hey Elixir Community! A few months back, I open sourced a link management system we had built into an app. It’s now got enough features ...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API. Docs are at OpenaiEx User Guide — ope...
New
rkallos
Peep is a new TelemetryMetrics reporter that supports both StatsD (and Dogstatsd) and Prometheus. While load testing a new Websocket-bas...
New
fuelen
Hey folks! Want to present a toolkit for writing command-line user interfaces. It provides a convenient interface for colorizing text...
New
germsvel
PhoenixTest provides a unified way of writing feature tests – regardless of whether you’re testing LiveView pages or static pages. It al...
New

Other popular topics Top

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

We're in Beta

About us Mission Statement