Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Implementation ¶
type Implementation struct {
Summary string
Description *string
Path string
PerVerb map[Verb]VerbImplementation
}
User-provided metadata containing information on the implementation to be converted to OpenAPI spec (all verbs at one path).
type Spec ¶
type Spec struct {
// Short summary for all operations on this path.
Summary string `json:"summary,omitempty"`
// Longer description for all operations on this path. May include Markdown.
Description *string `json:"description,omitempty"`
// A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined in the OpenAPI Object’s components.parameters.
//
// In the current implementation, we expect that this contains the path parameters.
Parameters *[]parameter.Parameter `json:"parameters,omitempty"`
Get *operation.Spec `json:"get,omitempty"`
Put *operation.Spec `json:"put,omitempty"`
Post *operation.Spec `json:"post,omitempty"`
Delete *operation.Spec `json:"delete,omitempty"`
Options *operation.Spec `json:"options,omitempty"`
Patch *operation.Spec `json:"patch,omitempty"`
}
Specifications for one path (all verbs).
func FromPath ¶
func FromPath(impl Implementation) (Spec, error)
type VerbImplementation ¶
type VerbImplementation struct {
// The type of inputs.
//
// This must be either the zero value (no input) or a struct containing
// no other field than `Body`, `Query`, `Path`, `Header`.
Input reflect.Type
// Security requirements for this endpoint.
Security []security.Requirement
// A human-readable summary explaining what this endpoint does.
Summary string
// A more detailed description. May contain markdown.
Description *string
// Reference to external documentation.
ExternalDocs *doc.External
// Information on the response.
Response response.Implementation
// If `true`, mark this endpoint as deprecated.
Deprecated bool
}
User-provided metadata containing information on the implementation to be converted to OpenAPI spec (a single verb at one path).
Click to show internal directories.
Click to hide internal directories.