core

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct {
	marshaller.CoreModel `model:"callback"`
	sequencedmap.Map[string, *Reference[*PathItem]]

	Extensions core.Extensions `key:"extensions"`
}

type Components

type Components struct {
	marshaller.CoreModel `model:"components"`

	Schemas         marshaller.Node[*sequencedmap.Map[string, oascore.JSONSchema]]          `key:"schemas"`
	Responses       marshaller.Node[*sequencedmap.Map[string, *Reference[*Response]]]       `key:"responses"`
	Parameters      marshaller.Node[*sequencedmap.Map[string, *Reference[*Parameter]]]      `key:"parameters"`
	Examples        marshaller.Node[*sequencedmap.Map[string, *Reference[*Example]]]        `key:"examples"`
	RequestBodies   marshaller.Node[*sequencedmap.Map[string, *Reference[*RequestBody]]]    `key:"requestBodies"`
	Headers         marshaller.Node[*sequencedmap.Map[string, *Reference[*Header]]]         `key:"headers"`
	SecuritySchemes marshaller.Node[*sequencedmap.Map[string, *Reference[*SecurityScheme]]] `key:"securitySchemes"`
	Links           marshaller.Node[*sequencedmap.Map[string, *Reference[*Link]]]           `key:"links"`
	Callbacks       marshaller.Node[*sequencedmap.Map[string, *Reference[*Callback]]]       `key:"callbacks"`
	PathItems       marshaller.Node[*sequencedmap.Map[string, *Reference[*PathItem]]]       `key:"pathItems"`

	Extensions core.Extensions `key:"extensions"`
}

type Contact

type Contact struct {
	marshaller.CoreModel `model:"contact"`

	Name       marshaller.Node[*string] `key:"name"`
	URL        marshaller.Node[*string] `key:"url"`
	Email      marshaller.Node[*string] `key:"email"`
	Extensions core.Extensions          `key:"extensions"`
}

type Encoding

type Encoding struct {
	marshaller.CoreModel `model:"encoding"`

	ContentType   marshaller.Node[*string]                                        `key:"contentType"`
	Headers       marshaller.Node[*sequencedmap.Map[string, *Reference[*Header]]] `key:"headers"`
	Style         marshaller.Node[*string]                                        `key:"style"`
	Explode       marshaller.Node[*bool]                                          `key:"explode"`
	AllowReserved marshaller.Node[*bool]                                          `key:"allowReserved"`
	Extensions    core.Extensions                                                 `key:"extensions"`
}

type Example

type Example struct {
	marshaller.CoreModel `model:"example"`

	Summary       marshaller.Node[*string]      `key:"summary"`
	Description   marshaller.Node[*string]      `key:"description"`
	Value         marshaller.Node[values.Value] `key:"value"`
	ExternalValue marshaller.Node[*string]      `key:"externalValue"`
	Extensions    core.Extensions               `key:"extensions"`
}
type Header struct {
	marshaller.CoreModel `model:"header"`

	Description marshaller.Node[*string]                                         `key:"description"`
	Required    marshaller.Node[*bool]                                           `key:"required"`
	Deprecated  marshaller.Node[*bool]                                           `key:"deprecated"`
	Style       marshaller.Node[*string]                                         `key:"style"`
	Explode     marshaller.Node[*bool]                                           `key:"explode"`
	Schema      marshaller.Node[oascore.JSONSchema]                              `key:"schema"`
	Content     marshaller.Node[*sequencedmap.Map[string, *MediaType]]           `key:"content"`
	Example     marshaller.Node[values.Value]                                    `key:"example"`
	Examples    marshaller.Node[*sequencedmap.Map[string, *Reference[*Example]]] `key:"examples"`
	Extensions  core.Extensions                                                  `key:"extensions"`
}

type Info

type Info struct {
	marshaller.CoreModel `model:"info"`

	Title          marshaller.Node[string]   `key:"title"`
	Version        marshaller.Node[string]   `key:"version"`
	Summary        marshaller.Node[*string]  `key:"summary"`
	Description    marshaller.Node[*string]  `key:"description"`
	TermsOfService marshaller.Node[*string]  `key:"termsOfService"`
	Contact        marshaller.Node[*Contact] `key:"contact"`
	License        marshaller.Node[*License] `key:"license"`
	Extensions     core.Extensions           `key:"extensions"`
}

type License

type License struct {
	marshaller.CoreModel `model:"license"`

	Name       marshaller.Node[string]  `key:"name"`
	Identifier marshaller.Node[*string] `key:"identifier"`
	URL        marshaller.Node[*string] `key:"url"`
	Extensions core.Extensions          `key:"extensions"`
}
type Link struct {
	marshaller.CoreModel `model:"link"`

	OperationID  marshaller.Node[*string]                                                                  `key:"operationId"`
	OperationRef marshaller.Node[*string]                                                                  `key:"operationRef"`
	Parameters   marshaller.Node[*sequencedmap.Map[string, marshaller.Node[expression.ValueOrExpression]]] `key:"parameters"`
	RequestBody  marshaller.Node[expression.ValueOrExpression]                                             `key:"requestBody"`
	Description  marshaller.Node[*string]                                                                  `key:"description"`
	Server       marshaller.Node[*Server]                                                                  `key:"server"`
	Extensions   core.Extensions                                                                           `key:"extensions"`
}

type MediaType

type MediaType struct {
	marshaller.CoreModel `model:"mediaType"`

	Schema     marshaller.Node[oascore.JSONSchema]                              `key:"schema"`
	Encoding   marshaller.Node[*sequencedmap.Map[string, *Encoding]]            `key:"encoding"`
	Example    marshaller.Node[values.Value]                                    `key:"example"`
	Examples   marshaller.Node[*sequencedmap.Map[string, *Reference[*Example]]] `key:"examples"`
	Extensions core.Extensions                                                  `key:"extensions"`
}

type OAuthFlow

type OAuthFlow struct {
	marshaller.CoreModel `model:"oAuthFlow"`

	AuthorizationURL marshaller.Node[*string]                           `key:"authorizationUrl"`
	TokenURL         marshaller.Node[*string]                           `key:"tokenUrl"`
	RefreshURL       marshaller.Node[*string]                           `key:"refreshUrl"`
	Scopes           marshaller.Node[*sequencedmap.Map[string, string]] `key:"scopes"`
	Extensions       core.Extensions                                    `key:"extensions"`
}

type OAuthFlows

type OAuthFlows struct {
	marshaller.CoreModel `model:"oAuthFlows"`

	Implicit          marshaller.Node[*OAuthFlow] `key:"implicit"`
	Password          marshaller.Node[*OAuthFlow] `key:"password"`
	ClientCredentials marshaller.Node[*OAuthFlow] `key:"clientCredentials"`
	AuthorizationCode marshaller.Node[*OAuthFlow] `key:"authorizationCode"`
	Extensions        core.Extensions             `key:"extensions"`
}

type OpenAPI

type OpenAPI struct {
	marshaller.CoreModel `model:"openapi"`

	OpenAPI      marshaller.Node[string]                                           `key:"openapi"`
	Info         marshaller.Node[Info]                                             `key:"info"`
	ExternalDocs marshaller.Node[*oas3core.ExternalDocumentation]                  `key:"externalDocs"`
	Tags         marshaller.Node[[]*Tag]                                           `key:"tags"`
	Servers      marshaller.Node[[]*Server]                                        `key:"servers"`
	Security     marshaller.Node[[]*SecurityRequirement]                           `key:"security"`
	Paths        marshaller.Node[*Paths]                                           `key:"paths"`
	Webhooks     marshaller.Node[*sequencedmap.Map[string, *Reference[*PathItem]]] `key:"webhooks"`

	Components marshaller.Node[*Components] `key:"components"`

	JSONSchemaDialect marshaller.Node[*string] `key:"jsonSchemaDialect"`

	Extensions core.Extensions `key:"extensions"`
}

type Operation

type Operation struct {
	marshaller.CoreModel `model:"operation"`

	OperationID  marshaller.Node[*string]                                          `key:"operationId"`
	Summary      marshaller.Node[*string]                                          `key:"summary"`
	Description  marshaller.Node[*string]                                          `key:"description"`
	Tags         marshaller.Node[[]marshaller.Node[string]]                        `key:"tags"`
	Servers      marshaller.Node[[]*Server]                                        `key:"servers"`
	Security     marshaller.Node[[]*SecurityRequirement]                           `key:"security"`
	Parameters   marshaller.Node[[]*Reference[*Parameter]]                         `key:"parameters"`
	RequestBody  marshaller.Node[*Reference[*RequestBody]]                         `key:"requestBody"`
	Responses    marshaller.Node[*Responses]                                       `key:"responses"`
	Callbacks    marshaller.Node[*sequencedmap.Map[string, *Reference[*Callback]]] `key:"callbacks"`
	Deprecated   marshaller.Node[*bool]                                            `key:"deprecated"`
	ExternalDocs marshaller.Node[*oas3core.ExternalDocumentation]                  `key:"externalDocs"`
	Extensions   core.Extensions                                                   `key:"extensions"`
}

type Parameter

type Parameter struct {
	marshaller.CoreModel `model:"parameter"`

	Name            marshaller.Node[string]                                          `key:"name"`
	In              marshaller.Node[string]                                          `key:"in"`
	Description     marshaller.Node[*string]                                         `key:"description"`
	Required        marshaller.Node[*bool]                                           `key:"required"`
	Deprecated      marshaller.Node[*bool]                                           `key:"deprecated"`
	AllowEmptyValue marshaller.Node[*bool]                                           `key:"allowEmptyValue"`
	Style           marshaller.Node[*string]                                         `key:"style"`
	Explode         marshaller.Node[*bool]                                           `key:"explode"`
	AllowReserved   marshaller.Node[*bool]                                           `key:"allowReserved"`
	Schema          marshaller.Node[oascore.JSONSchema]                              `key:"schema"`
	Content         marshaller.Node[*sequencedmap.Map[string, *MediaType]]           `key:"content"`
	Example         marshaller.Node[values.Value]                                    `key:"example"`
	Examples        marshaller.Node[*sequencedmap.Map[string, *Reference[*Example]]] `key:"examples"`
	Extensions      core.Extensions                                                  `key:"extensions"`
}

type PathItem

type PathItem struct {
	marshaller.CoreModel `model:"pathItem"`
	sequencedmap.Map[string, *Operation]

	Summary     marshaller.Node[*string] `key:"summary"`
	Description marshaller.Node[*string] `key:"description"`

	Servers    marshaller.Node[[]*Server]                `key:"servers"`
	Parameters marshaller.Node[[]*Reference[*Parameter]] `key:"parameters"`

	Extensions core.Extensions `key:"extensions"`
}

func NewPathItem

func NewPathItem() *PathItem

type Paths

type Paths struct {
	marshaller.CoreModel `model:"paths"`
	sequencedmap.Map[string, *Reference[*PathItem]]

	Extensions core.Extensions `key:"extensions"`
}

func NewPaths

func NewPaths() *Paths

type Reference

type Reference[T marshaller.CoreModeler] struct {
	marshaller.CoreModel `model:"reference"`

	Reference   marshaller.Node[*string] `key:"$ref"`
	Summary     marshaller.Node[*string] `key:"summary"`
	Description marshaller.Node[*string] `key:"description"`

	Object T `populatorValue:"true"`
}

func (*Reference[T]) SyncChanges

func (r *Reference[T]) SyncChanges(ctx context.Context, model any, valueNode *yaml.Node) (*yaml.Node, error)

func (*Reference[T]) Unmarshal

func (r *Reference[T]) Unmarshal(ctx context.Context, parentName string, node *yaml.Node) ([]error, error)

type RequestBody

type RequestBody struct {
	marshaller.CoreModel `model:"requestBody"`

	Description marshaller.Node[*string]                               `key:"description"`
	Content     marshaller.Node[*sequencedmap.Map[string, *MediaType]] `key:"content" required:"true"`
	Required    marshaller.Node[*bool]                                 `key:"required"`
	Extensions  core.Extensions                                        `key:"extensions"`
}

type Response

type Response struct {
	marshaller.CoreModel `model:"response"`

	Description marshaller.Node[string]                                         `key:"description"`
	Headers     marshaller.Node[*sequencedmap.Map[string, *Reference[*Header]]] `key:"headers"`
	Content     marshaller.Node[*sequencedmap.Map[string, *MediaType]]          `key:"content"`
	Links       marshaller.Node[*sequencedmap.Map[string, *Reference[*Link]]]   `key:"links"`
	Extensions  core.Extensions                                                 `key:"extensions"`
}

type Responses

type Responses struct {
	marshaller.CoreModel `model:"responses"`
	*sequencedmap.Map[string, *Reference[*Response]]

	Default    marshaller.Node[*Reference[*Response]] `key:"default"`
	Extensions core.Extensions                        `key:"extensions"`
}

type SecurityRequirement

type SecurityRequirement struct {
	marshaller.CoreModel `model:"securityRequirement"`
	sequencedmap.Map[string, marshaller.Node[[]marshaller.Node[string]]]
}

func (*SecurityRequirement) GetMapKeyNodeOrRoot

func (s *SecurityRequirement) GetMapKeyNodeOrRoot(key string, rootNode *yaml.Node) *yaml.Node

type SecurityScheme

type SecurityScheme struct {
	marshaller.CoreModel `model:"securityScheme"`

	Type             marshaller.Node[string]      `key:"type"`
	Description      marshaller.Node[*string]     `key:"description"`
	Name             marshaller.Node[*string]     `key:"name"`
	In               marshaller.Node[*string]     `key:"in"`
	Scheme           marshaller.Node[*string]     `key:"scheme"`
	BearerFormat     marshaller.Node[*string]     `key:"bearerFormat"`
	Flows            marshaller.Node[*OAuthFlows] `key:"flows"`
	OpenIdConnectUrl marshaller.Node[*string]     `key:"openIdConnectUrl"`
	Extensions       core.Extensions              `key:"extensions"`
}

type Server

type Server struct {
	marshaller.CoreModel `model:"server"`

	URL         marshaller.Node[string]                                     `key:"url"`
	Description marshaller.Node[*string]                                    `key:"description"`
	Variables   marshaller.Node[*sequencedmap.Map[string, *ServerVariable]] `key:"variables"`
	Extensions  core.Extensions                                             `key:"extensions"`
}

type ServerVariable

type ServerVariable struct {
	marshaller.CoreModel `model:"serverVariable"`

	Default     marshaller.Node[string]                    `key:"default"`
	Enum        marshaller.Node[[]marshaller.Node[string]] `key:"enum"`
	Description marshaller.Node[*string]                   `key:"description"`
	Extensions  core.Extensions                            `key:"extensions"`
}

type Tag

type Tag struct {
	marshaller.CoreModel `model:"tag"`

	Name         marshaller.Node[string]                          `key:"name"`
	Description  marshaller.Node[*string]                         `key:"description"`
	ExternalDocs marshaller.Node[*oas3core.ExternalDocumentation] `key:"externalDocs"`
	Extensions   core.Extensions                                  `key:"extensions"`
}

Jump to

Keyboard shortcuts

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