Documentation
¶
Overview ¶
Package openapi exposes the embedded OpenAPI spec for runtime documentation lookups, e.g., the `cub <entity> explain` commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
type Schema struct {
Description string `yaml:"description"`
Type string `yaml:"type"`
Format string `yaml:"format"`
Enum []string `yaml:"enum"`
Properties map[string]*Schema `yaml:"properties"`
Items *Schema `yaml:"items"`
AdditionalProperties *Schema `yaml:"additionalProperties"`
Ref string `yaml:"$ref"`
AllOf []*Schema `yaml:"allOf"`
AnyOf []*Schema `yaml:"anyOf"`
OneOf []*Schema `yaml:"oneOf"`
ReadOnly bool `yaml:"readOnly"`
Nullable bool `yaml:"nullable"`
Required []string `yaml:"required"`
Pattern string `yaml:"pattern"`
Example any `yaml:"example"`
}
Schema is a minimal projection of an OpenAPI schema, sufficient for surfacing human-readable property documentation.
func LookupSchema ¶
LookupSchema returns the named top-level schema from the embedded OpenAPI spec. The error indicates either a parse failure or an unknown schema name.
func Resolve ¶ added in v0.8.8
Resolve returns the schema s stands for: the one its $ref names, or its allOf's one member names, followed until it is neither. A reference to a schema the spec does not have resolves to nil. The result is shared, and must not be modified.
func (*Schema) PropertyNames ¶
PropertyNames returns the names of a schema's properties in sorted order.
func (*Schema) RefName ¶
RefName returns the last segment of a $ref pointer (e.g., "#/components/schemas/UpdateType" -> "UpdateType"), or "" if the schema is not a reference. A property that references a schema and also has a description or readOnly of its own is written as an allOf of that one $ref, since siblings of a $ref are ignored, so that form names the schema too.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package goclientnew provides primitives to interact with the openapi HTTP API.
|
Package goclientnew provides primitives to interact with the openapi HTTP API. |