openapi

package
v0.428.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const OpenApiSpecificationVersion = "3.1.0"

Variables

This section is empty.

Functions

func BoolPointer added in v0.413.2

func BoolPointer(v bool) *bool

func StringPointer added in v0.413.1

func StringPointer(v string) *string

Types

type ComponentsObject

type ComponentsObject struct {
	Schemas map[string]jsonschema.JSONSchema `json:"schemas,omitempty"`
}

type InfoObject

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

type MediaTypeObject

type MediaTypeObject struct {
	Schema jsonschema.JSONSchema `json:"schema,omitempty"`
}

type OpenAPI

type OpenAPI struct {
	OpenAPI    string                    `json:"openapi"`
	Info       InfoObject                `json:"info"`
	Paths      map[string]PathItemObject `json:"paths,omitempty"`
	Components *ComponentsObject         `json:"components,omitempty"`
}

OpenAPI spec object - https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md

func Generate

func Generate(ctx context.Context, schema *proto.Schema, api *proto.Api) OpenAPI

Generate creates an OpenAPI 3.1 spec for the passed api.

func GenerateFlows added in v0.413.1

func GenerateFlows(ctx context.Context, schema *proto.Schema) OpenAPI

GenerateFlows generates an openAPI schema for the Flows API for the given schema.

func GenerateJob

func GenerateJob(ctx context.Context, schema *proto.Schema, jobName string) OpenAPI

func GenerateTasks added in v0.418.0

func GenerateTasks(ctx context.Context, schema *proto.Schema) OpenAPI

GenerateTasks generates an openAPI schema for the Tasks API for the given schema.

type OperationObject

type OperationObject struct {
	OperationID *string                   `json:"operationId,omitempty"`
	RequestBody *RequestBodyObject        `json:"requestBody,omitempty"`
	Responses   map[string]ResponseObject `json:"responses,omitempty"`
}

type ParameterObject added in v0.413.1

type ParameterObject struct {
	Name        string                `json:"name"`
	In          string                `json:"in"`
	Required    bool                  `json:"required"`
	Description string                `json:"description"`
	Schema      jsonschema.JSONSchema `json:"schema"`
	Style       string                `json:"style,omitempty"`
	Explode     *bool                 `json:"explode,omitempty"`
}

type PathItemObject

type PathItemObject struct {
	Post       *OperationObject  `json:"post,omitempty"`
	Get        *OperationObject  `json:"get,omitempty"`
	Put        *OperationObject  `json:"put,omitempty"`
	Parameters []ParameterObject `json:"parameters,omitempty"`
}

type RequestBodyObject

type RequestBodyObject struct {
	Description string                     `json:"description"`
	Content     map[string]MediaTypeObject `json:"content,omitempty"`
	Required    *bool                      `json:"required,omitempty"`
}

type ResponseObject

type ResponseObject struct {
	Description string                     `json:"description"`
	Content     map[string]MediaTypeObject `json:"content,omitempty"`
}

Jump to

Keyboard shortcuts

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