example

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store *store.Store, value any, opts ...Option) *base.Example

New builds an example from value and applies any additional example options.

func NewRef

func NewRef(name string) *base.Example

NewRef returns an example reference to the named component in components/examples.

Types

type Option

type Option func(*base.Example)

Option configures an OpenAPI example object.

func Description

func Description(s string) Option

Description sets the long description of the example.

func ExternalValue

func ExternalValue(url string) Option

ExternalValue sets a URL pointing to the literal example value. Mutually exclusive with the value argument to New.

func Reference

func Reference(ref string) Option

Reference sets a $ref to a named example component in components/examples.

func Summary

func Summary(s string) Option

Summary sets a short summary of the example.

Jump to

Keyboard shortcuts

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