examples

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package examples contains sample types used to exercise schema generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	// Unique sequential identifier.
	ID int `json:"id" jsonschema:"required"`
	// This comment will be ignored
	Name    string         `` /* 153-byte string literal not displayed */
	Friends []int          `json:"friends,omitempty" jsonschema_description:"list of IDs, omitted when empty"`
	Tags    map[string]any `json:"tags,omitempty"`

	// An array of pets the user cares for.
	Pets nested.Pets `json:"pets"`

	// Set of animal names to pets
	NamedPets nested.NamedPets `json:"named_pets"`

	// Set of plants that the user likes
	Plants []*nested.Plant `json:"plants" jsonschema:"title=Plants"`
}

User is used as a base to provide tests for comments. Don't forget to checkout the nested path.

Directories

Path Synopsis
Package nested contains sample nested types used to exercise schema generation.
Package nested contains sample nested types used to exercise schema generation.

Jump to

Keyboard shortcuts

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