schema

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OperationInfo

type OperationInfo struct {
	Name           string          `json:"name"`
	Method         string          `json:"method"`
	Path           string          `json:"path"`
	Summary        string          `json:"summary,omitempty"`
	Description    string          `json:"description,omitempty"`
	Parameters     []ParameterInfo `json:"parameters,omitempty"`
	HasRequestBody bool            `json:"has_request_body,omitempty"`
	RequiredScope  string          `json:"required_scope,omitempty"`
}

OperationInfo describes a single API operation.

type ParameterInfo

type ParameterInfo struct {
	Name     string `json:"name"`
	In       string `json:"in"`
	Required bool   `json:"required"`
	Type     string `json:"type"`
}

ParameterInfo describes a single parameter of an API operation.

type ResourceInfo

type ResourceInfo struct {
	Resource   string          `json:"resource"`
	Operations []OperationInfo `json:"operations"`
}

ResourceInfo describes a CLI resource and its available API operations.

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

Schema holds the parsed OpenAPI spec and provides methods to query it.

func New

func New(specData []byte) (*Schema, error)

New creates a Schema from raw YAML bytes of an OpenAPI spec.

func (*Schema) Describe

func (s *Schema) Describe(resource string) (*ResourceInfo, error)

Describe returns detailed information about all operations for a given CLI resource.

func (*Schema) ListResources

func (s *Schema) ListResources() []string

ListResources returns a sorted list of available CLI resource names.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL