Skip to main content
Module

x/fun/mod.ts>json_schema.array

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function json_schema.array
import { json_schema } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { array } = json_schema;

Creates a JsonBuilder of an Array with values that match the supplied JsonBuilder

Examples

Example 1

import * as J from "./json_schema.ts";
import { pipe } from "./fn.ts";

// schema === { type: "array", items: { type: "number" } }
const schema = J.print(J.array(J.number()));

Returns

JsonBuilder<ReadonlyArray<A>>