spec

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(c Comment)

Register registers a comment to the default registry.

Types

type Comment

type Comment interface {
	Tag() string
	Usage() string
	ParseInto(c string, s *openapi.Extendable[openapi.OpenAPI]) error
}

type ExternalDocsDescriptionComment

type ExternalDocsDescriptionComment struct{}

func (*ExternalDocsDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ExternalDocsDescriptionComment) Tag

Tag implements Comment.

func (*ExternalDocsDescriptionComment) Usage

Usage implements Comment.

type ExternalDocsURLComment

type ExternalDocsURLComment struct{}

func (*ExternalDocsURLComment) ParseInto

ParseInto implements Comment.

func (*ExternalDocsURLComment) Tag

func (c *ExternalDocsURLComment) Tag() string

Tag implements Comment.

func (*ExternalDocsURLComment) Usage

func (c *ExternalDocsURLComment) Usage() string

Usage implements Comment.

type InfoContactEmailComment

type InfoContactEmailComment struct{}

func (*InfoContactEmailComment) ParseInto

ParseInto implements Comment.

func (*InfoContactEmailComment) Tag

Tag implements Comment.

func (*InfoContactEmailComment) Usage

func (c *InfoContactEmailComment) Usage() string

Usage implements Comment.

type InfoContactNameComment

type InfoContactNameComment struct{}

func (*InfoContactNameComment) ParseInto

ParseInto implements Comment.

func (*InfoContactNameComment) Tag

func (c *InfoContactNameComment) Tag() string

Tag implements Comment.

func (*InfoContactNameComment) Usage

func (c *InfoContactNameComment) Usage() string

Usage implements Comment.

type InfoContactURLComment

type InfoContactURLComment struct{}

func (*InfoContactURLComment) ParseInto

ParseInto implements Comment.

func (*InfoContactURLComment) Tag

func (c *InfoContactURLComment) Tag() string

Tag implements Comment.

func (*InfoContactURLComment) Usage

func (c *InfoContactURLComment) Usage() string

Usage implements Comment.

type InfoDescriptionComment

type InfoDescriptionComment struct{}

func (*InfoDescriptionComment) ParseInto

ParseInto implements Comment.

func (*InfoDescriptionComment) Tag

func (c *InfoDescriptionComment) Tag() string

Tag implements Comment.

func (*InfoDescriptionComment) Usage

func (c *InfoDescriptionComment) Usage() string

Usage implements Comment.

type InfoLicenseIdentifierComment

type InfoLicenseIdentifierComment struct{}

func (*InfoLicenseIdentifierComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseIdentifierComment) Tag

Tag implements Comment.

func (*InfoLicenseIdentifierComment) Usage

Usage implements Comment.

type InfoLicenseNameComment

type InfoLicenseNameComment struct{}

func (*InfoLicenseNameComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseNameComment) Tag

func (c *InfoLicenseNameComment) Tag() string

Tag implements Comment.

func (*InfoLicenseNameComment) Usage

func (c *InfoLicenseNameComment) Usage() string

Usage implements Comment.

type InfoLicenseURLComment

type InfoLicenseURLComment struct{}

func (*InfoLicenseURLComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseURLComment) Tag

func (c *InfoLicenseURLComment) Tag() string

Tag implements Comment.

func (*InfoLicenseURLComment) Usage

func (c *InfoLicenseURLComment) Usage() string

Usage implements Comment.

type InfoSummaryComment

type InfoSummaryComment struct{}

func (*InfoSummaryComment) ParseInto

ParseInto implements Comment.

func (*InfoSummaryComment) Tag

func (c *InfoSummaryComment) Tag() string

Tag implements Comment.

func (*InfoSummaryComment) Usage

func (c *InfoSummaryComment) Usage() string

Usage implements Comment.

type InfoTermsOfServiceComment

type InfoTermsOfServiceComment struct{}

func (*InfoTermsOfServiceComment) ParseInto

ParseInto implements Comment.

func (*InfoTermsOfServiceComment) Tag

Tag implements Comment.

func (*InfoTermsOfServiceComment) Usage

func (c *InfoTermsOfServiceComment) Usage() string

Usage implements Comment.

type InfoTitleComment

type InfoTitleComment struct{}

func (*InfoTitleComment) ParseInto

func (c *InfoTitleComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*InfoTitleComment) Tag

func (c *InfoTitleComment) Tag() string

InfoTitleComment implements Comment.

func (*InfoTitleComment) Usage

func (c *InfoTitleComment) Usage() string

Usage implements Comment.

type InfoVersionComment

type InfoVersionComment struct{}

func (*InfoVersionComment) ParseInto

ParseInto implements Comment.

func (*InfoVersionComment) Tag

func (c *InfoVersionComment) Tag() string

Tag implements Comment.

func (*InfoVersionComment) Usage

func (c *InfoVersionComment) Usage() string

Usage implements Comment.

type Registry

type Registry interface {
	Register(c Comment)
	Parse(line string, spec *openapi.Extendable[openapi.OpenAPI]) error
	Comments() []Comment
}

Registry allows to register and parse comments.

func Default

func Default() Registry

func NewRegistry

func NewRegistry() Registry

NewRegistry creates a new Registry.

type SecurityComment

type SecurityComment struct{}

SecurityComment is a comment that updates the security of the global specification.

func (*SecurityComment) ParseInto

func (c *SecurityComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*SecurityComment) Tag

func (c *SecurityComment) Tag() string

Tag implements Comment.

func (*SecurityComment) Usage

func (c *SecurityComment) Usage() string

Usage implements Comment.

type SecuritySchemeBearerFormatComment

type SecuritySchemeBearerFormatComment struct{}

SecuritySchemeBearerFormatComment is a comment that updates the 'bearerFormat' property of a security scheme.

func (*SecuritySchemeBearerFormatComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeBearerFormatComment) Tag

Tag implements Comment.

func (*SecuritySchemeBearerFormatComment) Usage

Usage implements Comment.

type SecuritySchemeComment

type SecuritySchemeComment struct{}

SecuritySchemeComment is a comment that adds a security scheme to the specification.

func (*SecuritySchemeComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeComment) Tag

func (c *SecuritySchemeComment) Tag() string

Tag implements Comment.

func (*SecuritySchemeComment) Usage

func (c *SecuritySchemeComment) Usage() string

Usage implements Comment.

type SecuritySchemeInComment

type SecuritySchemeInComment struct{}

SecuritySchemeInComment is a comment that updates the 'in' property of a security scheme.

func (*SecuritySchemeInComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeInComment) Tag

Tag implements Comment.

func (*SecuritySchemeInComment) Usage

func (c *SecuritySchemeInComment) Usage() string

Usage implements Comment.

type SecuritySchemeNameComment

type SecuritySchemeNameComment struct{}

SecuritySchemeNameComment is a comment that updates the name of a security scheme.

func (*SecuritySchemeNameComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeNameComment) Tag

Tag implements Comment.

func (*SecuritySchemeNameComment) Usage

func (c *SecuritySchemeNameComment) Usage() string

Usage implements Comment.

type SecuritySchemeSchemeComment

type SecuritySchemeSchemeComment struct{}

SecuritySchemeSchemeComment is a comment that updates the 'scheme' property of a security scheme.

func (*SecuritySchemeSchemeComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeSchemeComment) Tag

Tag implements Comment.

func (*SecuritySchemeSchemeComment) Usage

Usage implements Comment.

type ServerDescriptionComment

type ServerDescriptionComment struct{}

ServerDescriptionComment is a comment that updates the description of the last added server.

func (*ServerDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ServerDescriptionComment) Tag

Tag implements Comment.

func (*ServerDescriptionComment) Usage

func (c *ServerDescriptionComment) Usage() string

Usage implements Comment.

type ServerURLComment

type ServerURLComment struct{}

ServerURLComment is a comment that adds a new server to the global specification.

func (*ServerURLComment) ParseInto

func (c *ServerURLComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*ServerURLComment) Tag

func (c *ServerURLComment) Tag() string

Tag implements Comment.

func (*ServerURLComment) Usage

func (c *ServerURLComment) Usage() string

Usage implements Comment.

type ServerVariableDefaultComment

type ServerVariableDefaultComment struct{}

ServerVariableDefaultComment sets the default value for a server variable.

func (*ServerVariableDefaultComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableDefaultComment) Tag

Tag implements Comment.

func (*ServerVariableDefaultComment) Usage

Usage implements Comment.

type ServerVariableDescriptionComment

type ServerVariableDescriptionComment struct{}

ServerVariableDescriptionComment sets the description for a server variable.

func (*ServerVariableDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableDescriptionComment) Tag

Tag implements Comment.

func (*ServerVariableDescriptionComment) Usage

Usage implements Comment.

type ServerVariableEnumComment

type ServerVariableEnumComment struct{}

ServerVariableEnumComment sets the enum values for a server variable.

func (*ServerVariableEnumComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableEnumComment) Tag

Tag implements Comment.

func (*ServerVariableEnumComment) Usage

func (c *ServerVariableEnumComment) Usage() string

Usage implements Comment.

type TagDescriptionComment

type TagDescriptionComment struct{}

func (*TagDescriptionComment) ParseInto

ParseInto implements Comment.

func (*TagDescriptionComment) Tag

func (c *TagDescriptionComment) Tag() string

Tag implements Comment.

func (*TagDescriptionComment) Usage

func (c *TagDescriptionComment) Usage() string

Usage implements Comment.

type TagExternalDocsDescriptionComment

type TagExternalDocsDescriptionComment struct{}

func (*TagExternalDocsDescriptionComment) ParseInto

ParseInto implements Comment.

func (*TagExternalDocsDescriptionComment) Tag

Tag implements Comment.

func (*TagExternalDocsDescriptionComment) Usage

Usage implements Comment.

type TagExternalDocsURLComment

type TagExternalDocsURLComment struct{}

func (*TagExternalDocsURLComment) ParseInto

ParseInto implements Comment.

func (*TagExternalDocsURLComment) Tag

Tag implements Comment.

func (*TagExternalDocsURLComment) Usage

func (c *TagExternalDocsURLComment) Usage() string

Usage implements Comment.

type TagNameComment

type TagNameComment struct{}

func (*TagNameComment) ParseInto

func (c *TagNameComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*TagNameComment) Tag

func (c *TagNameComment) Tag() string

Tag implements Comment.

func (*TagNameComment) Usage

func (c *TagNameComment) Usage() string

Usage implements Comment.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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