spec

package
v0.3.0-beta.28 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPath is the canonical generated OpenAPI output location.
	DefaultPath = "openapi/compozy.json"
)
View Source
const RequestUploadForm = "multipart/form-data"

RequestUploadForm documents a multipart upload carrying one required binary "file" field.

Variables

This section is empty.

Functions

func Document

func Document() (*openapi3.T, error)

Document builds the canonical OpenAPI specification document.

func Render

func Render() ([]byte, error)

Render renders the canonical OpenAPI document as deterministic JSON bytes.

func WriteFile

func WriteFile(path string) error

WriteFile renders the canonical OpenAPI document to the supplied path.

Types

type OperationAuth

type OperationAuth string

OperationAuth identifies the transport-owned trust boundary for an operation.

const (
	OperationAuthDevice         OperationAuth = "device"
	OperationAuthLocalSocket    OperationAuth = "local_socket"
	OperationAuthPrivatePreAuth OperationAuth = "private_pre_auth"
)

type OperationSpec

type OperationSpec struct {
	Stability   string
	Method      string
	Path        string
	OperationID string
	Summary     string
	Tags        []string
	Transports  []Transport
	Auth        map[Transport]OperationAuth
	Parameters  []ParameterSpec
	RequestBody any
	// RequestBodyOptional keeps a request body schema documented while allowing empty requests.
	RequestBodyOptional bool
	// RequestContentType overrides the request media type; an empty value uses application/json when RequestBody is set.
	// RequestUploadForm is the only non-JSON value accepted today.
	RequestContentType string
	Responses          []ResponseSpec
}

OperationSpec describes one canonical REST operation.

func Operations

func Operations() []OperationSpec

Operations returns the complete transport-neutral operation registry.

type ParameterSpec

type ParameterSpec struct {
	Name        string
	In          string
	Description string
	Required    bool
	Kind        string
	Format      string
	Enum        []string
	Pattern     string
	MaxLength   *uint64
	Maximum     *float64
}

ParameterSpec describes one OpenAPI parameter.

type ResponseSpec

type ResponseSpec struct {
	Status      int
	Default     bool
	Description string
	Body        any
	Bodies      responseBodies
	ContentType string
}

ResponseSpec describes one OpenAPI response.

type Transport

type Transport string

Transport identifies which daemon transport exposes a route.

const (
	TransportHTTP Transport = "http"
	TransportUDS  Transport = "uds"
)

Source Files

Jump to

Keyboard shortcuts

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