Documentation
¶
Index ¶
- func Components(routes []server.RouteMeta) map[string]*Schema
- func Emit(routes []server.RouteMeta, path, title string, opts ...Option) ([]string, error)
- func Reconcile(routes []server.RouteMeta, path, title string, opts ...Option) ([]string, error)
- type Operation
- type Option
- type Param
- type Schema
- type Spec
- type XMLObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
Ref string `yaml:"$ref,omitempty"`
Type string `yaml:"type,omitempty"`
Format string `yaml:"format,omitempty"`
Nullable bool `yaml:"nullable,omitempty"`
Description string `yaml:"description,omitempty"`
Enum []string `yaml:"enum,omitempty"`
Pattern string `yaml:"pattern,omitempty"`
MinLength *int `yaml:"minLength,omitempty"`
MaxLength *int `yaml:"maxLength,omitempty"`
Minimum *float64 `yaml:"minimum,omitempty"`
Maximum *float64 `yaml:"maximum,omitempty"`
ExclMinimum *float64 `yaml:"exclusiveMinimum,omitempty"`
ExclMaximum *float64 `yaml:"exclusiveMaximum,omitempty"`
MinItems *int `yaml:"minItems,omitempty"`
MaxItems *int `yaml:"maxItems,omitempty"`
Items *Schema `yaml:"items,omitempty"`
Properties map[string]*Schema `yaml:"properties,omitempty"`
AddProps *Schema `yaml:"additionalProperties,omitempty"`
Required []string `yaml:"required,omitempty"`
// A rule OpenAPI has no keyword for. Here rather than in the description
// because the generator has to be able to correct it, and it can never
// rewrite prose.
Constraints []string `yaml:"x-constraints,omitempty"`
XML *XMLObject `yaml:"xml,omitempty"`
}
Schema is the structural subset the generator owns; prose fields are reconcile's.
func (Schema) MarshalYAML ¶
3.1 spells a nullable scalar `type: [T,"null"]`. Patched onto the encoded node: a second struct listing every field is one field silently dropped from the document the day somebody adds it here and not there.
type Spec ¶
type XMLObject ¶
type XMLObject struct {
Name string `yaml:"name,omitempty"`
Namespace string `yaml:"namespace,omitempty"`
Attribute bool `yaml:"attribute,omitempty"`
Wrapped bool `yaml:"wrapped,omitempty"`
}
No Prefix: encoding/xml cannot declare one, and a keyword nothing fills is worse than a missing one.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Separate from openapi because it imports testing, which has no business in the graph of a package a server links.
|
Separate from openapi because it imports testing, which has no business in the graph of a package a server links. |
Click to show internal directories.
Click to hide internal directories.