Documentation
¶
Overview ¶
Package openapi validates pure Refine request/response execution contexts. It models no HTTP transport and performs no I/O.
Index ¶
Constants ¶
const NativeBindingsVersion = "refine.openapi.native/v1"
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 (*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 NativeBindings ¶
type NativeBindings struct {
Version string `json:"version"`
Operations []NativeOperationBinding `json:"operations"`
}
type NativeHeaderBinding ¶
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 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 ResponseBinding ¶
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.