openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	OpenAPI string              `json:"openapi" yaml:"openapi"`
	Info    Info                `json:"info" yaml:"info"`
	Servers []Server            `json:"servers" yaml:"servers"`
	Paths   map[string]PathItem `json:"paths" yaml:"paths"`
}

func LoadFile

func LoadFile(path string) (*Document, error)

func (*Document) Operations

func (d *Document) Operations() []OperationView

type Info

type Info struct {
	Title   string `json:"title" yaml:"title"`
	Version string `json:"version" yaml:"version"`
}

type MediaType

type MediaType struct {
	Schema Schema `json:"schema" yaml:"schema"`
}

type Operation

type Operation struct {
	OperationID string       `json:"operationId" yaml:"operationId"`
	Summary     string       `json:"summary" yaml:"summary"`
	Description string       `json:"description" yaml:"description"`
	Parameters  []Parameter  `json:"parameters" yaml:"parameters"`
	RequestBody *RequestBody `json:"requestBody" yaml:"requestBody"`
}

type OperationView

type OperationView struct {
	Path   string
	Method string
	Item   PathItem
	Op     *Operation
}

type Parameter

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

type PathItem

type PathItem struct {
	Summary     string     `json:"summary" yaml:"summary"`
	Description string     `json:"description" yaml:"description"`
	Get         *Operation `json:"get" yaml:"get"`
	Post        *Operation `json:"post" yaml:"post"`
	Put         *Operation `json:"put" yaml:"put"`
	Patch       *Operation `json:"patch" yaml:"patch"`
	Delete      *Operation `json:"delete" yaml:"delete"`
}

type RequestBody

type RequestBody struct {
	Required bool                 `json:"required" yaml:"required"`
	Content  map[string]MediaType `json:"content" yaml:"content"`
}

type Schema

type Schema struct {
	Type                 string            `json:"type" yaml:"type"`
	Format               string            `json:"format" yaml:"format"`
	Description          string            `json:"description" yaml:"description"`
	Required             []string          `json:"required" yaml:"required"`
	Properties           map[string]Schema `json:"properties" yaml:"properties"`
	Items                *Schema           `json:"items" yaml:"items"`
	Enum                 []any             `json:"enum" yaml:"enum"`
	AdditionalProperties any               `json:"additionalProperties" yaml:"additionalProperties"`
}

type Server

type Server struct {
	URL string `json:"url" yaml:"url"`
}

Jump to

Keyboard shortcuts

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