Documentation
¶
Overview ¶
Package openapi holds the OpenAPI document model of Auth-All. Core and plugins contribute operations. The document drives the generated TypeScript client and the published API contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientBinding ¶
type ClientBinding struct {
Namespace string `json:"namespace,omitempty"`
Method string `json:"method"`
// Redirect marks an operation that a browser follows instead of fetching.
Redirect bool `json:"redirect,omitempty"`
}
ClientBinding tells the client generator how to expose one operation.
A namespace groups methods, so a binding of namespace "signIn" and method "email" becomes auth.signIn.email(...) in the generated TypeScript client.
type Components ¶
Components holds reusable schemas.
type Document ¶
type Document struct {
OpenAPI string `json:"openapi"`
Info Info `json:"info"`
Servers []Server `json:"servers,omitempty"`
Paths map[string]PathItem `json:"paths"`
Components Components `json:"components"`
}
Document is an OpenAPI 3.0.3 document.
func (*Document) AddOperation ¶
AddOperation registers one operation. A duplicate method and path pair replaces the previous entry.
type Info ¶
type Info struct {
Title string `json:"title"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
}
Info describes the API.
type MediaType ¶
type MediaType struct {
Schema *Schema `json:"schema,omitempty"`
}
MediaType binds a schema to a content type.
type Operation ¶
type Operation struct {
OperationID string `json:"operationId"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
Responses map[string]Response `json:"responses"`
Client *ClientBinding `json:"x-authall-client,omitempty"`
}
Operation is one HTTP operation.
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
In string `json:"in"`
Required bool `json:"required,omitempty"`
Description string `json:"description,omitempty"`
Schema *Schema `json:"schema,omitempty"`
}
Parameter is one query or path parameter.
type RequestBody ¶
type RequestBody struct {
Required bool `json:"required,omitempty"`
Content map[string]MediaType `json:"content"`
}
RequestBody is a JSON request body.
func JSONBody ¶
func JSONBody(s *Schema) *RequestBody
JSONBody returns a required JSON request body for one schema.
type Response ¶
type Response struct {
Description string `json:"description"`
Content map[string]MediaType `json:"content,omitempty"`
}
Response is one response.
func JSONResponse ¶
JSONResponse returns a JSON response for one schema.
type Schema ¶
type Schema struct {
Ref string `json:"$ref,omitempty"`
Type string `json:"type,omitempty"`
Format string `json:"format,omitempty"`
Description string `json:"description,omitempty"`
Nullable bool `json:"nullable,omitempty"`
Properties map[string]*Schema `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
Items *Schema `json:"items,omitempty"`
Enum []string `json:"enum,omitempty"`
AdditionalProperties *Schema `json:"additionalProperties,omitempty"`
}
Schema is a JSON schema subset.