example

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Examples provided as part of the OpenAPI spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExample

func GetExample(typ reflect.Type) *shared.Json

Utility cast to HasExample, get the example.

func GetExamples

func GetExamples(typ reflect.Type) *map[string]Example

Utility cast to HasExamples, get the examples.

Types

type Example

type Example interface {
	// contains filtered or unexported methods
}

Example Object | Reference Object

type HasExample

type HasExample interface {
	Example() shared.Json
}

Implement this to add a single example of a type without comments.

type HasExamples

type HasExamples interface {
	Examples() map[string]Example
}

Implement this to add commented examples.

type Reference

type Reference shared.Reference

A reference to a Component.

func Ref

func Ref(to string) Reference

type Spec

type Spec struct {
	Summary       string
	Description   string
	Value         *shared.Json
	ExternalValue *string
}

https://spec.openapis.org/oas/v3.0.1.html#example-object

Jump to

Keyboard shortcuts

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