Documentation
¶
Index ¶
- func GetSchemas(schema *OpenAPISchema) map[string]SchemaProperty
- type ConfigSchema
- type EndpointSchema
- type ExtraHeader
- type ModelMap
- type OpenAPISchema
- type Property
- type ProviderConfig
- type ProviderEndpoints
- type SchemaField
- type SchemaProperty
- type Section
- type Setting
- type Transform
- type TransformMap
- type TransformRef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSchemas ¶
func GetSchemas(schema *OpenAPISchema) map[string]SchemaProperty
Types ¶
type ConfigSchema ¶
type EndpointSchema ¶
type EndpointSchema struct { Endpoint string `yaml:"endpoint"` Method string `yaml:"method"` Schema struct { Request SchemaProperty `yaml:"request"` Response SchemaProperty `yaml:"response"` } `yaml:"schema"` }
type ExtraHeader ¶
type ExtraHeader struct {
Values []string
}
ExtraHeader can be either string or []string
func (*ExtraHeader) UnmarshalYAML ¶
func (h *ExtraHeader) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements custom unmarshaling for ExtraHeader
type ModelMap ¶
type ModelMap struct { Source string `yaml:"source,omitempty"` Transform []TransformRef `yaml:"transform"` }
type OpenAPISchema ¶
type OpenAPISchema struct { Components struct { Schemas struct { Config struct { XConfig ConfigSchema `yaml:"x-config"` } `yaml:"Config"` Providers struct { XProviderConfigs map[string]ProviderConfig `yaml:"x-provider-configs"` } `yaml:"Providers"` AuthType SchemaProperty `yaml:"AuthType"` Message SchemaProperty `yaml:"Message"` Model SchemaProperty `yaml:"Model"` ListResponse SchemaProperty `yaml:"ListModelsResponse"` GenerateRequest SchemaProperty `yaml:"GenerateRequest"` GenerateResponse SchemaProperty `yaml:"GenerateResponse"` ResponseToken SchemaProperty `yaml:"ResponseTokens"` } } }
OpenAPI schema structures
func Read ¶
func Read(openapi string) (*OpenAPISchema, error)
type Property ¶
type Property struct { Type string `yaml:"type"` Format string `yaml:"format,omitempty"` Description string `yaml:"description,omitempty"` Ref string `yaml:"$ref,omitempty"` Enum []string `yaml:"enum,omitempty"` Properties map[string]Property `yaml:"properties,omitempty"` Items *Property `yaml:"items,omitempty"` }
type ProviderConfig ¶
type ProviderConfig struct { ID string `yaml:"id"` URL string `yaml:"url"` AuthType string `yaml:"auth_type"` ExtraHeaders map[string]ExtraHeader `yaml:"extra_headers"` Endpoints map[string]EndpointSchema `yaml:"endpoints"` }
type ProviderEndpoints ¶
type SchemaField ¶
type SchemaField struct { Type string `yaml:"type"` Properties map[string]SchemaField `yaml:"properties"` Items *SchemaField `yaml:"items"` Ref string `yaml:"$ref"` }
type SchemaProperty ¶
type SchemaProperty struct { Type string `yaml:"type"` Description string `yaml:"description"` Properties map[string]Property `yaml:"properties"` Required []string `yaml:"required,omitempty"` Items *Property `yaml:"items,omitempty"` Enum []string `yaml:"enum,omitempty"` XTransform *Transform `yaml:"x-transform,omitempty"` }
Structures for OpenAPI schema parsing
type Transform ¶
type Transform struct { Target string `yaml:"target"` Mapping TransformMap `yaml:"mapping"` }
type TransformMap ¶
type TransformRef ¶
Click to show internal directories.
Click to hide internal directories.