Documentation
¶
Index ¶
- Constants
- type Expression
- func (e Expression) GetJSONPointer() jsonpointer.JSONPointer
- func (e Expression) GetParts() (ExpressionType, string, []string, jsonpointer.JSONPointer)
- func (e Expression) GetType() ExpressionType
- func (e Expression) IsExpression() bool
- func (e Expression) String() string
- func (e Expression) Validate() error
- type ExpressionType
- type ValueOrExpression
Constants ¶
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 ¶
func (e Expression) GetParts() (ExpressionType, string, []string, jsonpointer.JSONPointer)
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.