openapi

package
v0.0.0-...-35c18bc Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComponentRefer

func NewComponentRefer(group string, id string) jsonschema.Refer

Types

type Callback

type Callback struct {
	Reference
	CallbackObject
	SpecExtensions
}

func NewCallback

func NewCallback(method HttpMethod, rule RuntimeExpression, op *Operation) *Callback

func (Callback) MarshalJSON

func (i Callback) MarshalJSON() ([]byte, error)

func (*Callback) UnmarshalJSON

func (i *Callback) UnmarshalJSON(data []byte) error

type CallbackObject

type CallbackObject map[RuntimeExpression]*PathItem

type Components

type Components struct {
	ComponentsObject
	jsonschema.VendorExtensible
}

func (Components) MarshalJSON

func (i Components) MarshalJSON() ([]byte, error)

func (*Components) UnmarshalJSON

func (i *Components) UnmarshalJSON(data []byte) error

type ComponentsObject

type ComponentsObject struct {
	Schemas    map[string]*Schema    `json:"schemas,omitempty"`
	Responses  map[string]*Response  `json:"responses,omitempty"`
	Parameters map[string]*Parameter `json:"parameters,omitempty"`
	WithExamples
	RequestBodies map[string]*RequestBody `json:"requestBodies,omitempty"`
	WithHeaders
	WithSecuritySchemes
	WithLinks
	WithCallbacks
}

func (*ComponentsObject) AddParameter

func (object *ComponentsObject) AddParameter(id string, p *Parameter)

func (*ComponentsObject) AddRequestBody

func (object *ComponentsObject) AddRequestBody(id string, e *RequestBody)

func (*ComponentsObject) AddResponse

func (object *ComponentsObject) AddResponse(id string, r *Response)

func (*ComponentsObject) AddSchema

func (object *ComponentsObject) AddSchema(id string, s *jsonschema.Schema)

func (*ComponentsObject) RefCallback

func (object *ComponentsObject) RefCallback(id string) *Callback

func (*ComponentsObject) RefExample

func (object *ComponentsObject) RefExample(id string) *Example

func (*ComponentsObject) RefHeader

func (object *ComponentsObject) RefHeader(id string) *Header
func (object *ComponentsObject) RefLink(id string) *Link

func (*ComponentsObject) RefParameter

func (object *ComponentsObject) RefParameter(id string) *Parameter

func (*ComponentsObject) RefRequestBody

func (object *ComponentsObject) RefRequestBody(id string) *RequestBody

func (*ComponentsObject) RefResponse

func (object *ComponentsObject) RefResponse(id string) *Response

func (*ComponentsObject) RefSchema

func (object *ComponentsObject) RefSchema(id string) *jsonschema.Schema

func (*ComponentsObject) RequireSecurity

func (object *ComponentsObject) RequireSecurity(id string, scopes ...string) SecurityRequirement

type Contact

type Contact struct {
	ContactObject
	SpecExtensions
}

func (Contact) MarshalJSON

func (i Contact) MarshalJSON() ([]byte, error)

func (*Contact) UnmarshalJSON

func (i *Contact) UnmarshalJSON(data []byte) error

type ContactObject

type ContactObject struct {
	Name  string `json:"name,omitempty"`
	URL   string `json:"url,omitempty"`
	Email string `json:"email,omitempty"`
}

type Encoding

type Encoding struct {
	EncodingObject
	SpecExtensions
}

func NewEncoding

func NewEncoding() *Encoding

func (Encoding) MarshalJSON

func (i Encoding) MarshalJSON() ([]byte, error)

func (*Encoding) UnmarshalJSON

func (i *Encoding) UnmarshalJSON(data []byte) error

type EncodingObject

type EncodingObject struct {
	ContentType string `json:"contentType,omitempty"`
	WithHeaders
	Style         ParameterStyle `json:"style,omitempty"`
	Explode       bool           `json:"explode,omitempty"`
	AllowReserved bool           `json:"allowReserved,omitempty"`
}

type Example

type Example struct {
	Reference
	ExampleObject
	SpecExtensions
}

func NewExample

func NewExample() *Example

func (Example) MarshalJSON

func (e Example) MarshalJSON() ([]byte, error)

func (*Example) UnmarshalJSON

func (e *Example) UnmarshalJSON(data []byte) error

type ExampleObject

type ExampleObject struct {
	Summary       string      `json:"summary,omitempty"`
	Description   string      `json:"description,omitempty"`
	Value         interface{} `json:"value,omitempty"`
	ExternalValue string      `json:"externalValue,omitempty"`
}

type ExternalDoc

type ExternalDoc = jsonschema.ExternalDoc

func NewHeaderWithSchema

func NewHeaderWithSchema(s *Schema) *Header

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

func (*Header) UnmarshalJSON

func (h *Header) UnmarshalJSON(data []byte) error

type HttpMethod

type HttpMethod string
const (
	GET     HttpMethod = "get"
	PUT     HttpMethod = "put"
	POST    HttpMethod = "post"
	DELETE  HttpMethod = "delete"
	OPTIONS HttpMethod = "options"
	HEAD    HttpMethod = "head"
	PATCH   HttpMethod = "patch"
	TRACE   HttpMethod = "trace"
)

type Info

type Info struct {
	InfoObject
	SpecExtensions
}

func (Info) MarshalJSON

func (i Info) MarshalJSON() ([]byte, error)

func (*Info) UnmarshalJSON

func (i *Info) UnmarshalJSON(data []byte) error

type InfoObject

type InfoObject struct {
	Title          string `json:"title"`
	Description    string `json:"description,omitempty"`
	TermsOfService string `json:"termsOfService,omitempty"`
	*Contact       `json:"contact,omitempty"`
	*License       `json:"license,omitempty"`
	Version        string `json:"version"`
}

type License

type License struct {
	LicenseObject
	SpecExtensions
}

func (License) MarshalJSON

func (i License) MarshalJSON() ([]byte, error)

func (*License) UnmarshalJSON

func (i *License) UnmarshalJSON(data []byte) error

type LicenseObject

type LicenseObject struct {
	Name string `json:"name"`
	URL  string `json:"url,omitempty"`
}
type Link struct {
	Reference
	LinkObject
	SpecExtensions
}
func NewLink(operationId string) *Link

func (Link) MarshalJSON

func (l Link) MarshalJSON() ([]byte, error)

func (*Link) UnmarshalJSON

func (l *Link) UnmarshalJSON(data []byte) error

type LinkObject

type LinkObject struct {
	OperationRef string                       `json:"operationRef,omitempty"`
	OperationId  string                       `json:"operationId,omitempty"`
	Parameters   map[string]RuntimeExpression `json:"parameters,omitempty"`
	RequestBody  RuntimeExpression            `json:"requestBody,omitempty"`
	Description  string                       `json:"description,omitempty"`
	Server       *Server                      `json:"server,omitempty"`
}

func (*LinkObject) AddParameter

func (o *LinkObject) AddParameter(name string, expr RuntimeExpression)

func (*LinkObject) SetRequestBody

func (o *LinkObject) SetRequestBody(expr RuntimeExpression)

type MediaType

type MediaType struct {
	MediaTypeObject
	SpecExtensions
}

func NewMediaTypeWithSchema

func NewMediaTypeWithSchema(s *Schema) *MediaType

func (MediaType) MarshalJSON

func (i MediaType) MarshalJSON() ([]byte, error)

func (*MediaType) UnmarshalJSON

func (i *MediaType) UnmarshalJSON(data []byte) error

type MediaTypeObject

type MediaTypeObject struct {
	Schema  *Schema     `json:"schema,omitempty"`
	Example interface{} `json:"example,omitempty"`
	WithExamples
	WithEncoding
}

type OAuthFlow

type OAuthFlow struct {
	OAuthFlowObject
	SpecExtensions
}

func NewOAuthFlow

func NewOAuthFlow(authorizationURL string, tokenURL string, refreshURL string, scopes map[string]string) *OAuthFlow

func (OAuthFlow) MarshalJSON

func (i OAuthFlow) MarshalJSON() ([]byte, error)

func (*OAuthFlow) UnmarshalJSON

func (i *OAuthFlow) UnmarshalJSON(data []byte) error

type OAuthFlowObject

type OAuthFlowObject struct {
	AuthorizationURL string            `json:"authorizationUrl"`
	TokenURL         string            `json:"tokenUrl"`
	RefreshURL       string            `json:"refreshUrl,omitempty"`
	Scopes           map[string]string `json:"scopes"`
}

type OAuthFlows

type OAuthFlows struct {
	OAuthFlowsObject
	SpecExtensions
}

func (OAuthFlows) MarshalJSON

func (i OAuthFlows) MarshalJSON() ([]byte, error)

func (*OAuthFlows) UnmarshalJSON

func (i *OAuthFlows) UnmarshalJSON(data []byte) error

type OAuthFlowsObject

type OAuthFlowsObject struct {
	Implicit          *OAuthFlow `json:"implicit,omitempty"`
	Password          *OAuthFlow `json:"password,omitempty"`
	ClientCredentials *OAuthFlow `json:"clientCredentials,omitempty"`
	AuthorizationCode *OAuthFlow `json:"authorizationCode,omitempty"`
}

type OpenAPI

type OpenAPI struct {
	OpenAPIObject
	SpecExtensions
}
Example
openapi := NewOpenAPI()

openapi.Version = "1.0.0"
openapi.Title = "Swagger Petstore"
openapi.License = &License{
	LicenseObject: LicenseObject{
		Name: "MIT",
	},
}

openapi.AddTag(nil)
openapi.AddTag(NewTag("pets"))

openapi.AddSecurityScheme("token", NewHTTPSecurityScheme("bearer", "JWT"))

openapi.AddServer(NewServer("http://petstore.swagger.io/v1"))

openapi.AddSchema("Pet", jsonschema.ObjectOf(jsonschema.Props{
	"id":   jsonschema.Long(),
	"name": jsonschema.String(),
	"tag":  jsonschema.String(),
}, "id", "name"))

openapi.AddSchema("Pets", jsonschema.ItemsOf(openapi.RefSchema("Pet")))

openapi.AddSchema("Error", jsonschema.ObjectOf(jsonschema.Props{
	"code":    jsonschema.Integer(),
	"message": jsonschema.String(),
}, "code", "message"))

{
	op := NewOperation("listPets")
	op.Summary = "List all pets"
	op.Tags = []string{"pets"}

	parameterLimit := QueryParameter("limit", jsonschema.Integer(), false).
		WithDesc("How many items to return at one time (max 100)")

	op.AddParameter(parameterLimit)

	{
		resp := NewResponse("An paged array of pets")

		s := jsonschema.String()
		s.Description = "A link to the next page of responses"
		resp.AddHeader("x-next", NewHeaderWithSchema(s))
		resp.AddContent("application/json", NewMediaTypeWithSchema(openapi.RefSchema("Pets")))

		op.AddResponse(http.StatusOK, resp)
	}

	{
		resp := NewResponse("unexpected error")
		resp.AddContent("application/json", NewMediaTypeWithSchema(openapi.RefSchema("Error")))

		op.SetDefaultResponse(resp)
	}

	openapi.AddOperation(GET, "/pets", op)
}

{
	op := NewOperation("createPets")
	op.Summary = "Create a pet"
	op.Tags = []string{"pets"}

	{
		resp := NewResponse("Null response")

		op.AddResponse(http.StatusNoContent, resp)
	}

	{
		resp := NewResponse("unexpected error")
		resp.AddContent("application/json", NewMediaTypeWithSchema(openapi.RefSchema("Error")))

		op.SetDefaultResponse(resp)
	}

	openapi.AddOperation(POST, "/pets", op)
}

data, _ := json.MarshalIndent(openapi, "\t", "\t")
fmt.Println(string(data))
// Output
Output:

func NewOpenAPI

func NewOpenAPI() *OpenAPI

func (OpenAPI) MarshalJSON

func (i OpenAPI) MarshalJSON() ([]byte, error)

func (*OpenAPI) UnmarshalJSON

func (i *OpenAPI) UnmarshalJSON(data []byte) error

type OpenAPIObject

type OpenAPIObject struct {
	OpenAPI string `json:"openapi"`
	Info    `json:"info"`
	Paths   `json:"paths"`
	WithServers
	WithSecurityRequirement
	WithTags
	Components `json:"components"`
}

type Operation

type Operation struct {
	OperationObject
	SpecExtensions
}

func NewOperation

func NewOperation(operationId string) *Operation

func (Operation) MarshalJSON

func (op Operation) MarshalJSON() ([]byte, error)

func (*Operation) UnmarshalJSON

func (op *Operation) UnmarshalJSON(data []byte) error

func (Operation) WithDesc

func (op Operation) WithDesc(desc string) *Operation

func (Operation) WithSummary

func (op Operation) WithSummary(summary string) *Operation

func (Operation) WithTags

func (op Operation) WithTags(tags ...string) *Operation

type OperationGetter

type OperationGetter interface {
	OpenAPIOperation(ref func(t string) jsonschema.Refer) *Operation
}

type OperationObject

type OperationObject struct {
	Tags         []string     `json:"tags,omitempty"`
	Summary      string       `json:"summary,omitempty"`
	Description  string       `json:"description,omitempty"`
	OperationId  string       `json:"operationId"`
	Parameters   []*Parameter `json:"parameters,omitempty"`
	RequestBody  *RequestBody `json:"requestBody,omitempty"`
	Responses    Responses    `json:"responses"`
	ExternalDocs *ExternalDoc `json:"externalDocs,omitempty"`
	WithCallbacks
	WithSecurityRequirement
	WithServers
	Deprecated bool `json:"deprecated,omitempty"`
}

func (*OperationObject) AddParameter

func (object *OperationObject) AddParameter(p *Parameter)

func (*OperationObject) AddResponse

func (o *OperationObject) AddResponse(statusCode int, r *Response)

func (*OperationObject) SetDefaultResponse

func (o *OperationObject) SetDefaultResponse(r *Response)

func (*OperationObject) SetRequestBody

func (o *OperationObject) SetRequestBody(rb *RequestBody)

type Operations

type Operations struct {
	Operations map[HttpMethod]*Operation
}

func (*Operations) AddOperation

func (v *Operations) AddOperation(method HttpMethod, op *Operation)

func (Operations) MarshalJSON

func (v Operations) MarshalJSON() ([]byte, error)

func (*Operations) UnmarshalJSON

func (v *Operations) UnmarshalJSON(data []byte) error

type Parameter

type Parameter struct {
	Reference
	ParameterObject
	SpecExtensions
}

func CookieParameter

func CookieParameter(name string, s *Schema, required bool) *Parameter

func HeaderParameter

func HeaderParameter(name string, s *Schema, required bool) *Parameter

func PathParameter

func PathParameter(name string, s *Schema) *Parameter

func QueryParameter

func QueryParameter(name string, s *Schema, required bool) *Parameter

func (Parameter) MarshalJSON

func (p Parameter) MarshalJSON() ([]byte, error)

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(data []byte) error

func (Parameter) WithDesc

func (p Parameter) WithDesc(desc string) *Parameter

type ParameterCommonObject

type ParameterCommonObject struct {
	Description     string `json:"description,omitempty"`
	Required        bool   `json:"required,omitempty"`
	Deprecated      bool   `json:"deprecated,omitempty"`
	AllowEmptyValue bool   `json:"allowEmptyValue,omitempty"`

	Style         ParameterStyle `json:"style,omitempty"`
	Explode       bool           `json:"explode,omitempty"`
	AllowReserved bool           `json:"allowReserved,omitempty"`

	WithContentOrSchema
	Example interface{} `json:"example,omitempty"`
	WithExamples
}

type ParameterObject

type ParameterObject struct {
	Name string   `json:"name"`
	In   Position `json:"in"`
	ParameterCommonObject
}

type ParameterStyle

type ParameterStyle string
const (
	// https://tools.ietf.org/html/rfc6570#section-3.2.7
	ParameterStyleMatrix ParameterStyle = "matrix"
	// https://tools.ietf.org/html/rfc6570#section-3.2.5
	ParameterStyleLabel ParameterStyle = "label"
	// https://tools.ietf.org/html/rfc6570#section-3.2.8
	ParameterStyleForm ParameterStyle = "form"
	// for array, csv https://tools.ietf.org/html/rfc6570#section-3.2.2
	ParameterStyleSimple ParameterStyle = "simple"
	// for array, ssv
	ParameterStyleSpaceDelimited ParameterStyle = "spaceDelimited"
	// for array, pipes
	ParameterStylePipeDelimited ParameterStyle = "pipeDelimited"
	// for object
	ParameterStyleDeepObject ParameterStyle = "deepObject"
)

type PathItem

type PathItem struct {
	Operations
	PathItemObject
	SpecExtensions
}

func (PathItem) MarshalJSON

func (i PathItem) MarshalJSON() ([]byte, error)

func (*PathItem) UnmarshalJSON

func (i *PathItem) UnmarshalJSON(data []byte) error

type PathItemObject

type PathItemObject struct {
	Summary     string `json:"summary,omitempty"`
	Description string `json:"description,omitempty"`

	Servers    []*Server    `json:"servers,omitempty"`
	Parameters []*Parameter `json:"parameters,omitempty"`
}

type Paths

type Paths struct {
	Paths map[string]*PathItem
	SpecExtensions
}

func (*Paths) AddOperation

func (p *Paths) AddOperation(method HttpMethod, path string, op *Operation)

func (Paths) MarshalJSON

func (p Paths) MarshalJSON() ([]byte, error)

func (*Paths) UnmarshalJSON

func (p *Paths) UnmarshalJSON(data []byte) error

type Position

type Position string
const (
	PositionQuery  Position = "query"
	PositionPath   Position = "path"
	PositionHeader Position = "header"
	PositionCookie Position = "cookie"
)

type Reference

type Reference = jsonschema.Reference

type RequestBody

type RequestBody struct {
	Reference
	RequestBodyObject
	SpecExtensions
}

func NewRequestBody

func NewRequestBody(desc string, required bool) *RequestBody

func (RequestBody) MarshalJSON

func (r RequestBody) MarshalJSON() ([]byte, error)

func (*RequestBody) UnmarshalJSON

func (r *RequestBody) UnmarshalJSON(data []byte) error

type RequestBodyObject

type RequestBodyObject struct {
	Description string `json:"description,omitempty"`
	Required    bool   `json:"required,omitempty"`
	WithContent
}

type Response

type Response struct {
	Reference
	ResponseObject
	SpecExtensions
}

func NewResponse

func NewResponse(desc string) *Response

func (Response) MarshalJSON

func (r Response) MarshalJSON() ([]byte, error)

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(data []byte) error

type ResponseObject

type ResponseObject struct {
	Description string `json:"description"`
	WithHeaders
	WithContent
	WithLinks
}

type Responses

type Responses struct {
	ResponsesObject
	SpecExtensions
}

func (Responses) MarshalJSON

func (i Responses) MarshalJSON() ([]byte, error)

func (*Responses) UnmarshalJSON

func (i *Responses) UnmarshalJSON(data []byte) error

type ResponsesObject

type ResponsesObject struct {
	Default   *Response
	Responses map[int]*Response
}

func (*ResponsesObject) AddResponse

func (o *ResponsesObject) AddResponse(statusCode int, r *Response)

func (ResponsesObject) MarshalJSON

func (o ResponsesObject) MarshalJSON() ([]byte, error)

func (*ResponsesObject) SetDefaultResponse

func (o *ResponsesObject) SetDefaultResponse(r *Response)

func (*ResponsesObject) UnmarshalJSON

func (o *ResponsesObject) UnmarshalJSON(data []byte) error

type RuntimeExpression

type RuntimeExpression string

type Schema

type Schema = jsonschema.Schema

type SecurityRequirement

type SecurityRequirement map[string][]string

type SecurityScheme

type SecurityScheme struct {
	SecuritySchemeObject
	SpecExtensions
}

func NewAPIKeySecurityScheme

func NewAPIKeySecurityScheme(name string, in Position) *SecurityScheme

func NewHTTPSecurityScheme

func NewHTTPSecurityScheme(scheme string, bearerFormat string) *SecurityScheme

func NewOAuth2SecurityScheme

func NewOAuth2SecurityScheme(oauthFlowsObject OAuthFlowsObject) *SecurityScheme

func NewOpenIdConnectSecurityScheme

func NewOpenIdConnectSecurityScheme(openIdConnectUrl string) *SecurityScheme

func (SecurityScheme) MarshalJSON

func (i SecurityScheme) MarshalJSON() ([]byte, error)

func (*SecurityScheme) UnmarshalJSON

func (i *SecurityScheme) UnmarshalJSON(data []byte) error

type SecuritySchemeObject

type SecuritySchemeObject struct {
	Type             SecurityType `json:"type"`
	Description      string       `json:"description,omitempty"`
	Name             string       `json:"name,omitempty"`
	In               Position     `json:"in,omitempty"`
	Scheme           string       `json:"scheme,omitempty"`
	BearerFormat     string       `json:"bearerFormat,omitempty"`
	Flows            *OAuthFlows  `json:"flows,omitempty"`
	OpenIdConnectUrl string       `json:"openIdConnectUrl,omitempty"`
}

type SecurityType

type SecurityType string
const (
	SecurityTypeAPIKey        SecurityType = "apiKey"
	SecurityTypeHttp          SecurityType = "http"
	SecurityTypeOAuth2        SecurityType = "oauth2"
	SecurityTypeOpenIdConnect SecurityType = "openIdConnect"
)

type Server

type Server struct {
	ServerObject
	SpecExtensions
}

func NewServer

func NewServer(url string) *Server

func (Server) MarshalJSON

func (i Server) MarshalJSON() ([]byte, error)

func (*Server) UnmarshalJSON

func (i *Server) UnmarshalJSON(data []byte) error

type ServerObject

type ServerObject struct {
	URL         string                     `json:"url"`
	Description string                     `json:"description,omitempty"`
	Variables   map[string]*ServerVariable `json:"variables,omitempty"`
}

func (*ServerObject) AddVariable

func (o *ServerObject) AddVariable(key string, v *ServerVariable)

type ServerVariable

type ServerVariable struct {
	ServerVariableObject
	SpecExtensions
}

func NewServerVariable

func NewServerVariable(defaultValue string) *ServerVariable

func (ServerVariable) MarshalJSON

func (i ServerVariable) MarshalJSON() ([]byte, error)

func (*ServerVariable) UnmarshalJSON

func (i *ServerVariable) UnmarshalJSON(data []byte) error

type ServerVariableObject

type ServerVariableObject struct {
	Default     string   `json:"default"`
	Enum        []string `json:"enum,omitempty"`
	Description string   `json:"description,omitempty"`
}

type SpecExtensions

type SpecExtensions = jsonschema.VendorExtensible

type Tag

type Tag struct {
	TagObject
	SpecExtensions
}

func NewTag

func NewTag(name string) *Tag

func (Tag) MarshalJSON

func (i Tag) MarshalJSON() ([]byte, error)

func (*Tag) UnmarshalJSON

func (i *Tag) UnmarshalJSON(data []byte) error

type TagObject

type TagObject struct {
	Name         string       `json:"name"`
	Description  string       `json:"description,omitempty"`
	ExternalDocs *ExternalDoc `json:"externalDocs,omitempty"`
}

type WithCallbacks

type WithCallbacks struct {
	Callbacks map[string]*Callback `json:"callbacks,omitempty"`
}

func (*WithCallbacks) AddCallback

func (o *WithCallbacks) AddCallback(name string, c *Callback)

type WithContent

type WithContent struct {
	Content map[string]*MediaType `json:"content,omitempty"`
}

func (*WithContent) AddContent

func (o *WithContent) AddContent(contentType string, mt *MediaType)

type WithContentOrSchema

type WithContentOrSchema struct {
	Schema *Schema `json:"schema,omitempty"`
	WithContent
}

func (*WithContentOrSchema) AddContent

func (o *WithContentOrSchema) AddContent(contentType string, mt *MediaType)

func (*WithContentOrSchema) SetSchema

func (o *WithContentOrSchema) SetSchema(s *Schema)

type WithEncoding

type WithEncoding struct {
	Encoding map[string]*Encoding `json:"encoding,omitempty"`
}

func (*WithEncoding) AddEncoding

func (o *WithEncoding) AddEncoding(name string, e *Encoding)

type WithExamples

type WithExamples struct {
	Examples map[string]*Example `json:"examples,omitempty"`
}

func (*WithExamples) AddExample

func (o *WithExamples) AddExample(name string, e *Example)

type WithHeaders

type WithHeaders struct {
	Headers map[string]*Header `json:"headers,omitempty"`
}

func (*WithHeaders) AddHeader

func (object *WithHeaders) AddHeader(name string, h *Header)
type WithLinks struct {
	Links map[string]*Link `json:"links,omitempty"`
}
func (object *WithLinks) AddLink(name string, l *Link)

type WithSecurityRequirement

type WithSecurityRequirement struct {
	Security []*SecurityRequirement `json:"security,omitempty"`
}

func (*WithSecurityRequirement) AddSecurityRequirement

func (o *WithSecurityRequirement) AddSecurityRequirement(sr *SecurityRequirement)

type WithSecuritySchemes

type WithSecuritySchemes struct {
	SecuritySchemes map[string]*SecurityScheme `json:"securitySchemes,omitempty"`
}

func (*WithSecuritySchemes) AddSecurityScheme

func (o *WithSecuritySchemes) AddSecurityScheme(name string, ss *SecurityScheme)

type WithServers

type WithServers struct {
	Servers []*Server `json:"servers,omitempty"`
}

func (*WithServers) AddServer

func (o *WithServers) AddServer(s *Server)

type WithTags

type WithTags struct {
	Tags []*Tag `json:"tags,omitempty"`
}

func (*WithTags) AddTag

func (o *WithTags) AddTag(t *Tag)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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