expression

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReferenceTypeHeader indicates that the expression represents a header reference in the request/response.
	ReferenceTypeHeader = "header"
	// ReferenceTypeQuery indicates that the expression represents a query reference in the request.
	ReferenceTypeQuery = "query"
	// ReferenceTypePath indicates that the expression represents a path reference in the request.
	ReferenceTypePath = "path"
	// ReferenceTypeBody indicates that the expression represents a body reference in the request/response.
	ReferenceTypeBody = "body"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Expression

type Expression string

Expression represents a runtime expression as defined by the OpenAPI & Arazzo specifications.

func ExtractExpressions

func ExtractExpressions(expression string) []Expression

ExtractExpressions will extract all the expressions from the provided string.

func GetValueOrExpressionValue

func GetValueOrExpressionValue(value ValueOrExpression) (*yaml.Node, *Expression, error)

GetValueOrExpressionValue will return the value or expression from the provided ValueOrExpression.

func (Expression) GetJSONPointer

func (e Expression) GetJSONPointer() jsonpointer.JSONPointer

GetJSONPointer will return the jsonpointer of the expression.

func (Expression) GetParts

GetParts will return the type, reference, expression parts and jsonpointer of the expression.

func (Expression) GetType

func (e Expression) GetType() ExpressionType

GetType will return the type of the expression.

func (Expression) IsExpression

func (e Expression) IsExpression() bool

IsExpression will return true if the expression is a runtime expression that starts with a valid expression type.

func (Expression) String added in v1.0.0

func (e Expression) String() string

func (Expression) Validate

func (e Expression) Validate() error

Validate will validate the expression is valid as per the OpenAPI & Arazzo specifications.

type ExpressionType

type ExpressionType string

ExpressionType represents the type of expression.

const (
	// ExpressionTypeURL indicates that the expression represents the request URL.
	ExpressionTypeURL ExpressionType = "url"
	// ExpressionTypeMethod indicates that the expression represents the request method.
	ExpressionTypeMethod ExpressionType = "method"
	// ExpressionTypeStatusCode indicates that the expression represents the response status code.
	ExpressionTypeStatusCode ExpressionType = "statusCode"
	// ExpressionTypeRequest indicates that the expression represents the request itself.
	ExpressionTypeRequest ExpressionType = "request"
	// ExpressionTypeResponse indicates that the expression represents the response itself.
	ExpressionTypeResponse ExpressionType = "response"
	// ExpressionTypeInputs indicates that the expression represents the inputs of the workflow.
	ExpressionTypeInputs ExpressionType = "inputs"
	// ExpressionTypeOutputs indicates that the expression represents the outputs of the step/workflow.
	ExpressionTypeOutputs ExpressionType = "outputs"
	// ExpressionTypeSteps indicates that the expression represents the steps of the workflow.
	ExpressionTypeSteps ExpressionType = "steps"
	// ExpressionTypeWorkflows indicates that the expression represents the workflows of the Arazzo document.
	ExpressionTypeWorkflows ExpressionType = "workflows"
	// ExpressionTypeSourceDescriptions indicates that the expression represents the source descriptions of the Arazzo document.
	ExpressionTypeSourceDescriptions ExpressionType = "sourceDescriptions"
	// ExpressionTypeComponents indicates that the expression represents the components of the Arazzo or OpenAPI document.
	ExpressionTypeComponents ExpressionType = "components"
)

TODO with specific in arazzo doc types we could validate the full expression include names etc match expectations

type ValueOrExpression

type ValueOrExpression = *yaml.Node

ValueOrExpression represents a raw value or expression in the Arazzo document.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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