package openapi3gen

import "github.com/getkin/kin-openapi/openapi3gen"

Package openapi3gen generates OpenAPI 3 schemas for Go types.

Index

Variables

var RefSchemaRef = openapi3.NewSchemaRef("Ref",
	openapi3.NewObjectSchema().WithProperty("$ref", openapi3.NewStringSchema().WithMinLength(1)))

Functions

func NewSchemaRefForValue

func NewSchemaRefForValue(value interface{}) (*openapi3.SchemaRef, map[*openapi3.SchemaRef]int, error)

Types

type CycleError

type CycleError struct{}

CycleError indicates that a type graph has one or more possible cycles.

func (*CycleError) Error

func (err *CycleError) Error() string

type Generator

type Generator struct {
	Types map[reflect.Type]*openapi3.SchemaRef

	// SchemaRefs contains all references and their counts.
	// If count is 1, it's not ne
	// An OpenAPI identifier has been assigned to each.
	SchemaRefs map[*openapi3.SchemaRef]int
}

func NewGenerator

func NewGenerator() *Generator

func (*Generator) GenerateSchemaRef

func (g *Generator) GenerateSchemaRef(t reflect.Type) (*openapi3.SchemaRef, error)

Source Files

openapi3gen.go

Version
v0.27.0
Published
Nov 12, 2020
Platform
js/wasm
Imports
6 packages
Last checked
2 minutes ago

Tools for package owners.