openapi

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation func(openapi.OperationContext)

func Deprecated

func Deprecated() Annotation

func Description

func Description(description string) Annotation

func EmptyResponse

func EmptyResponse(status int) Annotation

func FileResponse

func FileResponse(status int, contentType string) Annotation

func HtmlResponse

func HtmlResponse(status int) Annotation

func ID

func ID(id string) Annotation

func Request

func Request[T any]() Annotation

func Response

func Response[T any](status int) Annotation

func Summary

func Summary(summary string) Annotation

func Tags

func Tags(tags ...string) Annotation

type Annotations

type Annotations []Annotation

func Annotate

func Annotate(
	annotations ...Annotation,
) Annotations

Annotate a route with metadata for the OpenAPI spec.

func (*Annotations) Apply

func (annotations *Annotations) Apply(oc *openapi.OperationContext)

type OpenAPI

type OpenAPI struct {
	// contains filtered or unexported fields
}

func New

func New(title string,
	version string,
	description string,
	swaggerUiDistUrl string,
) *OpenAPI

func (*OpenAPI) Add

func (openapi *OpenAPI) Add(method string, path string, annotations Annotations) error

Adds a new operation to the OpenAPI spec

func (*OpenAPI) JsonSpecRoute

func (openapi *OpenAPI) JsonSpecRoute(c *gin.Context)

func (*OpenAPI) MarshalJSON

func (openapi *OpenAPI) MarshalJSON() ([]byte, error)

func (*OpenAPI) UiRoute

func (openapi *OpenAPI) UiRoute(c *gin.Context)

Jump to

Keyboard shortcuts

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