openapi

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultServiceFromSource

func DefaultServiceFromSource(source string) string

func ResolveServiceName

func ResolveServiceName(serviceOverride, title, sourceHint string) (string, error)

Types

type APISpec

type APISpec struct {
	Title   string     `json:"title"`
	Version string     `json:"version"`
	Paths   []PathItem `json:"paths"`
}

type GETOperation

type GETOperation struct {
	Path        string
	OperationID string
	Parameters  []Parameter
}

type Loader

type Loader interface {
	Load(ctx context.Context, ref string) (APISpec, error)
}

type NestedSpec

type NestedSpec struct {
	Title   string    `json:"title"`
	Version string    `json:"version"`
	Paths   *PathNode `json:"paths"`
}

func BuildNestedSpec

func BuildNestedSpec(api APISpec) (*NestedSpec, error)

type Operation

type Operation struct {
	OperationID string      `json:"operationId"`
	Parameters  []Parameter `json:"parameters,omitempty"`
}

type OperationSpec

type OperationSpec struct {
	ID           string          `json:"id"`
	PathTemplate string          `json:"pathTemplate"`
	PathFormat   string          `json:"pathFormat"`
	PathArgNames []string        `json:"pathArgNames"`
	QueryParams  []ParameterSpec `json:"queryParams"`
	HeaderParams []ParameterSpec `json:"headerParams"`
}

type Parameter

type Parameter struct {
	Name     string `json:"name"`
	In       string `json:"in"`
	Required bool   `json:"required"`
}

type ParameterSpec

type ParameterSpec struct {
	Name     string `json:"name"`
	Required bool   `json:"required"`
}

type Parser

type Parser interface {
	Parse(ctx context.Context, spec string) (APISpec, error)
}

type PathItem

type PathItem struct {
	Path       string      `json:"path"`
	Parameters []Parameter `json:"parameters,omitempty"`
	Get        *Operation  `json:"get,omitempty"`
}

type PathNode

type PathNode struct {
	Operation *OperationSpec       `json:"operation,omitempty"`
	Children  map[string]*PathNode `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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