header

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Headers, both within requests and within responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentImplementation

type ContentImplementation struct {
	Content map[string]media.Implementation
}

type ContentSpec

type ContentSpec struct {
	Content map[string]media.Type `json:"content"`
}

func FromContentImplementation

func FromContentImplementation(impl ContentImplementation) (ContentSpec, error)
type Header interface {
	// contains filtered or unexported methods
}

func FromImplementation

func FromImplementation(impl Implementation) (Header, error)

type Implementation

type Implementation struct {
	Description *string
	Required    bool
	Deprecated  bool
	SchemaSpec  *SchemaImplementation
	ContentSpec *ContentImplementation
}

User-provided metadata containing information on the implementation to be converted to OpenAPI spec.

type Reference

type Reference shared.Reference

A reference.

func Ref

func Ref(to string) Reference

type SchemaImplementation

type SchemaImplementation struct {
	Type     reflect.Type
	Example  *shared.Json
	Examples *[]example.Example
}

type SchemaSpec

type SchemaSpec struct {
	// Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for "query" - "form"; for "path" - "simple"; for "header" - "simple"; for "cookie" - "form".
	Style string `json:"style"`

	// When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this field has no effect. When style is "form", the default value is true. For all other styles, the default value is false. Note that despite false being the default for deepObject, the combination of false with deepObject is undefined.
	Explode bool `json:"explode"`

	Schema schema.Schema `json:"schema"`

	Example  *shared.Json       `json:"example,omitempty"`
	Examples *[]example.Example `json:"examples,omitempty"`
}

https://spec.openapis.org/oas/v3.0.1.html#schema-object

func FromSchemaImplementation

func FromSchemaImplementation(impl SchemaImplementation) (SchemaSpec, error)

type Spec

type Spec struct {
	Description  *string `json:"description"`
	Required     bool    `json:"required"`
	Deprecated   bool    `json:"deprecated"`
	*SchemaSpec  `json:"<renaming ignored>,omitempty" flatten:""`
	*ContentSpec `json:"<renaming also ignored>,omitempty" flatten:""`
}

https://spec.openapis.org/oas/v3.0.1.html#header-object

Jump to

Keyboard shortcuts

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