jscheam

Values

pub fn array(item_type: property.Type) -> property.Type

Creates an array type with the specified item type

pub fn boolean() -> property.Type

Creates a boolean type for JSON Schema

pub fn description(
  property: property.Property,
  desc: String,
) -> property.Property

Adds a description to a property for documentation purposes

pub fn float() -> property.Type

Creates a float/number type for JSON Schema

pub fn integer() -> property.Type

Creates an integer/number type for JSON Schema

pub fn object(
  properties: List(property.Property),
  additional_properties: Bool,
) -> property.Type

Creates an object type with the specified properties Set additional_properties to True to allow additional properties beyond those defined

pub fn optional(property: property.Property) -> property.Property

Makes a property optional (not required in the schema)

pub fn prop(
  name: String,
  property_type: property.Type,
) -> property.Property

Creates a property with the specified name and type Properties are required by default

pub fn string() -> property.Type

Creates a string type for JSON Schema

pub fn to_json(object_type: property.Type) -> json.Json

Converts a Type to a JSON Schema document This is the main function to generate JSON Schema from your type definitions

Search Document