util

package
v0.25.6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendComponents added in v0.9.1

func AppendComponents(spec *v3.Document, components *v3.Components)

func AppendStringDedupe added in v0.14.1

func AppendStringDedupe(strs []string, str string) []string

func BoolPtr

func BoolPtr(b bool) *bool

func ConvertNodeV3toV4 added in v0.16.2

func ConvertNodeV3toV4(n *yamlv3.Node) *yaml.Node

func FormatComments

func FormatComments(loc protoreflect.SourceLocation) string

func FormatOperationComments added in v0.16.2

func FormatOperationComments(loc protoreflect.SourceLocation) (summary string, description string)

func FormatTypeRef

func FormatTypeRef(t string) string

func IsEmpty

func IsEmpty(msg protoreflect.MessageDescriptor) bool

func IsFieldDeprecated added in v0.16.0

func IsFieldDeprecated(fd protoreflect.FieldDescriptor) *bool

func IsMethodDeprecated

func IsMethodDeprecated(md protoreflect.MethodDescriptor) *bool

func IsWellKnown

func IsWellKnown(msg protoreflect.MessageDescriptor) bool

func MakeFieldName added in v0.11.0

func MakeFieldName(opts options.Options, fd protoreflect.FieldDescriptor) string

func MakeMediaTypes

func MakeMediaTypes(opts options.Options, s *base.SchemaProxy, isRequest, isStreaming bool) *orderedmap.Map[string, *v3.MediaType]

MakeMediaTypes generates media types with references to the bodies

func MakePath added in v0.15.23

func MakePath(opts options.Options, main string) string

func MergeOrAppendParameter added in v0.24.0

func MergeOrAppendParameter(existingParams []*v3.Parameter, newParam *v3.Parameter) []*v3.Parameter

MergeOrAppendParameter merges or appends a parameter to a list of parameters.

func MergeParameters added in v0.25.2

func MergeParameters(existingParams []*v3.Parameter, newParams []*v3.Parameter) []*v3.Parameter

MergeParameters merges new parameters into existing parameters. It uses a map to efficiently check for duplicates and merge properties.

func MethodToRequestBody

func MethodToRequestBody(opts options.Options, method protoreflect.MethodDescriptor, s *base.SchemaProxy, isStreaming bool) *v3.RequestBody

func ResolveSchemaRef added in v0.23.0

func ResolveSchemaRef(ref string) string

ResolveSchemaRef takes a reference string and determines if it is a fully qualified protobuf message name. If so, it converts it to a valid OpenAPI schema reference. Otherwise, it returns the original string.

func Singular added in v0.16.2

func Singular(plural string) string

Singular returns the singular form of a given plural noun. .

func TypeFieldDescription added in v0.14.0

func TypeFieldDescription(opts options.Options, tt protoreflect.FieldDescriptor) string

Types

type IDSchema

type IDSchema struct {
	ID     string
	Schema *base.Schema
}

func NewGoogleAny

func NewGoogleAny() *IDSchema

func WellKnownToSchema added in v0.9.1

func WellKnownToSchema(msg protoreflect.MessageDescriptor) *IDSchema

Jump to

Keyboard shortcuts

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