openapimap

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package openapimap provides code to map openapi config from the proto messages to openapiv3 types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyMap

func AnyMap(items map[string]*structpb.Value) map[string]any

func AnySlice

func AnySlice(items []*structpb.Value) []any

func Components

func Components(components *openapi.Components) (*openapiv3.Components, error)

func Discriminator

func Discriminator(value *openapi.Discriminator) (*openapiv3.Discriminator, error)

func Document

func Document(doc *openapi.Document) (*openapiv3.Document, error)

func EncodingMap

func EncodingMap(encodings map[string]*openapi.Encoding) (map[string]*openapiv3.Encoding, error)

func Extensions

func Extensions(table map[string]*structpb.Value) (map[string]any, error)

func HeaderMap

func HeaderMap(headerMap map[string]*openapi.Header) (map[string]*openapiv3.Ref[openapiv3.Header], error)

func Info

func Info(info *openapi.Info) (*openapiv3.Info, error)

func LinksMap

func LinksMap(links map[string]*openapi.Link) (map[string]*openapiv3.Ref[openapiv3.Link], error)

func MakeReference

func MakeReference[T any](ref *openapi.Reference) *openapiv3.Ref[T]

func MediaTypes

func MediaTypes(mediaTypes map[string]*openapi.MediaType) (map[string]*openapiv3.MediaType, error)

func Operation

func Operation(operation *openapi.Operation) (*openapiv3.Operation, error)

func Parameter

func Parameter(paramFromProto *openapi.Parameter) (*openapiv3.Ref[openapiv3.Parameter], error)

func ParameterMap

func ParameterMap(parameterMap map[string]*openapi.Parameter) (map[string]*openapiv3.Ref[openapiv3.Parameter], error)

func ParameterSlice

func ParameterSlice(parameters []*openapi.Parameter) ([]*openapiv3.Ref[openapiv3.Parameter], error)

func RequestBody

func RequestBody(requestBody *openapi.RequestBody) (*openapiv3.Ref[openapiv3.RequestBody], error)

func RequestBodyMap

func RequestBodyMap(
	requestBodies map[string]*openapi.RequestBody) (map[string]*openapiv3.Ref[openapiv3.RequestBody], error)

func Response

func Response(response *openapi.Response) (*openapiv3.Ref[openapiv3.Response], error)

func ResponseMap

func ResponseMap(responses map[string]*openapi.Response) (map[string]*openapiv3.Ref[openapiv3.Response], error)

func Schema

func Schema(schema *openapi.Schema) (*openapiv3.Schema, error)

func SchemaItemSpec

func SchemaItemSpec(spec *openapi.Schema_Item) (*openapiv3.ItemSpec, error)

func SchemaList

func SchemaList(schemas []*openapi.Schema) ([]*openapiv3.Schema, error)

func SchemaMap

func SchemaMap(spec map[string]*openapi.Schema) (map[string]*openapiv3.Schema, error)

func SecurityRequirementSlice

func SecurityRequirementSlice(items []*openapi.SecurityRequirement) []map[string][]string

func SecuritySchemeMap

func SecuritySchemeMap(
	securitySchemes map[string]*openapi.SecurityScheme) (map[string]*openapiv3.Ref[openapiv3.SecurityScheme], error)

func Server

func Server(server *openapi.Server) (*openapiv3.Server, error)

func ServerSlice

func ServerSlice(servers []*openapi.Server) ([]*openapiv3.Server, error)

func StructuredExample

func StructuredExample(example *openapi.Example) (*openapiv3.Ref[openapiv3.Example], error)

func StructuredExampleMap

func StructuredExampleMap(examples map[string]*openapi.Example) (map[string]*openapiv3.Ref[openapiv3.Example], error)

func Tags

func Tags(tags []*openapi.Tag) ([]*openapiv3.Tag, error)

func Type

Types

This section is empty.

Jump to

Keyboard shortcuts

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