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

zachdaniel
Hey folks! AshEvents Release We’ve just released the first version of AshEvents, an Event Sourcing tool for Ash Framework apps. Check o...
New
BartOtten
This powerful library works together with Phoenix Router to provide the ultimate routing solution. It simplifies route manipulation, givi...
New
alvises
Hello everyone! :waving_hand: I’m excited to introduce my first Elixir library: YOLO, a library designed to make real-time object detect...
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
395 12072 119
New
MRdotB
Greetings Elixir community! Today, I’m thrilled to present you with resvg_nif, an open-source project that provides Elixir bindings for ...
New
lud
Hello! I’ve been working on the Oaskit library for a while now, and just released a first version. Since I’ve built JSV I wanted to be ...
New
rbino
Hey folks! I’m happy to introduce TigerBeetlex, an Elixir client for TigerBeetle, the financial transactions database. I’ve been working...
New
Asd
Hi, I am happy to release the Repatch library for mocking and patching implementation in tests and anywhere else. It brings new possibili...
New
sevensidedmarble
Announcing Live Toast: a replacement toast/flash component for Phoenix LiveView, heavily inspired by the look of Sonner (the amazing toas...
New
waseigo
I saw this LinkedIn post: *Can your programming language do this? This is a macro in Clojure called `dotrace`. When you surround a pie...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement