openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package openapi validates pure Refine request/response execution contexts. It models no HTTP transport and performs no I/O.

Index

Constants

View Source
const NativeBindingsVersion = "refine.openapi.native/v1"
View Source
const SchemaVersion = "refine.openapi.operations/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract struct {
	// contains filtered or unexported fields
}

func Compile

func Compile(program *language.Program, schema *Schema) (*Contract, error)

func (*Contract) Schema

func (c *Contract) Schema() Schema

func (*Contract) ValidateRequest

func (c *Contract) ValidateRequest(operationID string, request Request, limits validation.Limits) (validation.Report, error)

func (*Contract) ValidateResponse

func (c *Contract) ValidateResponse(operationID, status string, response Response, original *Request, limits validation.Limits) (validation.Report, error)

type Error

type Error struct{ Code, OperationID, Status, Message string }

func (*Error) Error

func (e *Error) Error() string

type NativeBindings

type NativeBindings struct {
	Version    string                   `json:"version"`
	Operations []NativeOperationBinding `json:"operations"`
}

type NativeHeaderBinding

type NativeHeaderBinding struct {
	Name      string   `json:"name"`
	FieldPath []string `json:"fieldPath,omitempty"`
}

type NativeMediaBinding

type NativeMediaBinding struct {
	MediaType string `json:"mediaType,omitempty"`
}

type NativeOperationBinding

type NativeOperationBinding struct {
	OperationID string                   `json:"operationId"`
	Parameters  []NativeParameterBinding `json:"parameters,omitempty"`
	RequestBody *NativeMediaBinding      `json:"requestBody,omitempty"`
	Responses   []NativeResponseBinding  `json:"responses"`
}

type NativeParameterBinding

type NativeParameterBinding struct {
	In        string   `json:"in"`
	Name      string   `json:"name"`
	FieldPath []string `json:"fieldPath,omitempty"`
}

type NativeResponseBinding

type NativeResponseBinding struct {
	Status  string                `json:"status"`
	Headers []NativeHeaderBinding `json:"headers,omitempty"`
	Body    *NativeMediaBinding   `json:"body,omitempty"`
}

type OperationBinding

type OperationBinding struct {
	OperationID string            `json:"operationId"`
	Method      string            `json:"method"`
	Path        string            `json:"path"`
	RequestType string            `json:"requestType"`
	Responses   []ResponseBinding `json:"responses"`
}

type Request

type Request struct {
	Parameters value.Data
	Headers    value.Data
	Body       value.Data
}

type Response

type Response struct {
	Headers value.Data
	Body    value.Data
}

type ResponseBinding

type ResponseBinding struct {
	Status       string `json:"status"`
	ResponseType string `json:"responseType"`
	ContextType  string `json:"contextType,omitempty"`
}

type Schema

type Schema struct {
	Version    string             `json:"version"`
	Operations []OperationBinding `json:"operations"`
	Native     *NativeBindings    `json:"native,omitempty"`
}

Native is optional because the v1 operation schema is also used by the pure Refine facade. When present it is an authoritative request/response wire binding that the native package reconciles with a validated OpenAPI document.

Jump to

Keyboard shortcuts

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