local T = require("alc_shapes.t")
local M = {}
local ALC_SCHEMA_KINDS = {
"any", "array_of", "described", "discriminated", "map_of",
"one_of", "optional", "prim", "ref", "shape",
}
local AlcSchema = T.shape({
kind = T.one_of(ALC_SCHEMA_KINDS),
}, { open = true })
M.Identity = T.shape({
name = T.string,
version = T.string,
category = T.string,
description = T.string,
source_path = T.string,
}, { open = false })
M.Section = T.shape({
level = T.one_of({ 2, 3 }),
heading = T.string,
anchor = T.string,
body_md = T.string,
}, { open = false })
M.Narrative = T.shape({
title = T.string,
summary = T.string,
sections = T.array_of(T.ref("Section")),
}, { open = false })
M.Shape = T.shape({
input = AlcSchema:is_optional(),
result = AlcSchema:is_optional(),
}, { open = false })
M.PkgInfo = T.shape({
identity = T.ref("Identity"),
narrative = T.ref("Narrative"),
shape = T.ref("Shape"),
}, { open = false })
return M