Rod

Sets & Maps

Validating unique collections and key-value pairs.

Sets & Maps

Rod's core is JSON-compatible. Sets and Maps are validated as arrays of unique items or entries.

Sets

Validates an array of items where every item must be unique.

use rod_rs::set;

let schema = set(string());
import { rod } from 'rod-js';

const schema = rod.set(rod.string());
# Coming soon in Python builders

Maps & Records

Use record for standard objects with dynamic keys, and map for arrays of entries [[key, value]].

use rod_rs::{record, map};

let scores = record(string(), number());
let config = map(string(), number());
import { rod } from 'rod-js';

const scores = rod.record(rod.string(), rod.number());
const config = rod.map(rod.string(), rod.number());
# Coming soon in Python builders

On this page