schema

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Overview

Package schema provides a fluent builder for JSON Schema objects. It outputs map[string]any compatible with agentcore's Tool.Schema() interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array

func Array(desc string, items map[string]any) map[string]any

Array returns an array schema with the given item schema.

func Bool

func Bool(desc string) map[string]any

Bool returns a boolean schema.

func Enum

func Enum(desc string, values ...string) map[string]any

Enum returns a string enum schema.

func Int

func Int(desc string) map[string]any

Int returns an integer schema.

func Number

func Number(desc string) map[string]any

Number returns a number schema.

func Object

func Object(props ...Prop) map[string]any

Object builds a JSON Schema object from the given properties.

func String

func String(desc string) map[string]any

String returns a string schema.

Types

type Prop

type Prop struct {
	// contains filtered or unexported fields
}

Prop is a named property with optional required flag.

func Property

func Property(name string, s map[string]any) Prop

Property creates a named schema property.

func (Prop) Required

func (p Prop) Required() Prop

Required marks this property as required.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL