schema

package
v0.6.30 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schema provides utilities for generating JSON schemas from Go types, enabling validation and documentation of tool and message parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSchema

func JSONSchema(t reflect.Type) *jsonschema.Schema

JSONSchema return the json schema of the configuration

func ToFunctionSchema

func ToFunctionSchema(tType reflect.Type, tSchema *jsonschema.Schema) *jsonschema.Schema

Types

type Faker

type Faker interface {
	Fake() any
}

Faker is a interface for generating structures with fake data. It is used for generating test data.

type Schema

type Schema struct {
	*jsonschema.Schema
	// Parameters represents the Function parameters definition
	Parameters any
}

func New

func New(t reflect.Type) (*Schema, error)

New creates a new schema from the given type

func (*Schema) NameFromRef

func (s *Schema) NameFromRef() string

func (*Schema) String

func (s *Schema) String() string

Jump to

Keyboard shortcuts

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