Documentation ¶
Index ¶
- Constants
- type CorrectionHint
- type ErrorDetails
- type ErrorType
- type Hint
- type LexerPos
- type NormalHint
- type TemplateLiterals
- type ValidationError
- type ValidationErrors
- func (v *ValidationErrors) Append(code string, data map[string]string, node node.ParserNode)
- func (v *ValidationErrors) AppendError(e *ValidationError)
- func (v *ValidationErrors) AppendWarning(e *ValidationError)
- func (v *ValidationErrors) Concat(verrs ValidationErrors)
- func (v ValidationErrors) Error() string
- func (verrs *ValidationErrors) ErrorsToAnnotatedSchema(sources []*reader.SchemaFile) string
- func (v ValidationErrors) HasErrors() bool
- func (v ValidationErrors) HasWarnings() bool
- func (verrs *ValidationErrors) ToAnnotatedSchema(sources []*reader.SchemaFile) string
- func (v ValidationErrors) Warning() string
- func (verrs *ValidationErrors) WarningsToAnnotatedSchema(sources []*reader.SchemaFile) string
Constants ¶
const ( ErrorUpperCamel = "E001" ErrorActionNameLowerCamel = "E002" ErrorFieldNamesUniqueInModel = "E003" ErrorActionUniqueGlobally = "E004" ErrorInvalidActionInput = "E005" ErrorReservedFieldName = "E006" ErrorUnsupportedFieldType = "E009" ErrorUniqueModelsGlobally = "E010" ErrorUnsupportedAttributeType = "E011" ErrorFieldNameLowerCamel = "E012" ErrorInvalidAttributeArgument = "E013" ErrorAttributeRequiresNamedArguments = "E014" ErrorAttributeMissingRequiredArgument = "E015" ErrorInvalidValue = "E016" ErrorUniqueAPIGlobally = "E017" ErrorUniqueRoleGlobally = "E018" ErrorUniqueEnumGlobally = "E019" ErrorUnresolvableExpression = "E020" ErrorForbiddenExpressionAction = "E022" ErrorIncorrectArguments = "E024" ErrorInvalidSyntax = "E025" ErrorExpressionTypeMismatch = "E026" ErrorForbiddenOperator = "E027" ErrorNonBooleanValueCondition = "E028" ErrorExpressionArrayMismatchingOperator = "E030" ErrorExpressionMixedTypesInArrayLiteral = "E032" ErrorCreateActionNoInputs = "E033" ErrorCreateActionMissingInput = "E034" ErrorNonDirectComparisonOperatorUsed = "E037" ErrorUnusedInput = "E038" ErrorInvalidOneToOneRelationship = "E039" ErrorInvalidActionType = "E040" ErrorModelNotAllowedAsInput = "E041" ErrorClashingImplicitInput = "E043" ErrorMissingRelationshipField = "E044" ErrorAmbiguousRelationship = "E045" ErrorModelNotFound = "E047" ErrorExpressionFieldTypeMismatch = "E048" ErrorExpressionMultipleConditions = "E049" ErrorDefaultExpressionNeeded = "E050" ErrorDefaultExpressionOperatorPresent = "E051" ErrorFieldNamesMaxLength = "E052" ErrorModelNamesMaxLength = "E053" ErrorCreateActionAmbiguousRelationship = "E059" ErrorExpressionTypeNotNullable = "E060" ErrorExpressionSingleConditionNotBoolean = "E061" )
error codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorrectionHint ¶
func NewCorrectionHint ¶
func NewCorrectionHint(referenceCollection []string, query string) *CorrectionHint
func (*CorrectionHint) ToString ¶
func (hint *CorrectionHint) ToString() string
type ErrorDetails ¶
type ErrorType ¶
type ErrorType string
const ( NamingError ErrorType = "NamingError" DuplicateDefinitionError ErrorType = "DuplicateDefinitionError" TypeError ErrorType = "TypeError" UndefinedError ErrorType = "UndefinedError" ActionInputError ErrorType = "ActionInputError" AttributeArgumentError ErrorType = "AttributeArgumentError" AttributeNotAllowedError ErrorType = "AttributeNotAllowedError" RelationshipError ErrorType = "RelationshipError" JobDefinitionError ErrorType = "JobDefinitionError" UnsupportedFeatureError ErrorType = "UnsupportedFeatureError" )
type NormalHint ¶
func NewHint ¶
func NewHint(message string) *NormalHint
func (*NormalHint) ToString ¶
func (hint *NormalHint) ToString() string
type TemplateLiterals ¶
type ValidationError ¶
type ValidationError struct { *ErrorDetails Code string `json:"code" regexp:"\\d+"` Pos LexerPos `json:"pos,omitempty"` EndPos LexerPos `json:"endPos,omitempty"` }
func NewValidationError ¶
func NewValidationError(code string, data TemplateLiterals, position node.ParserNode) *ValidationError
func NewValidationErrorWithDetails ¶
func NewValidationErrorWithDetails(t ErrorType, details ErrorDetails, position node.ParserNode) *ValidationError
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
type ValidationErrors ¶
type ValidationErrors struct { Errors []*ValidationError `json:"errors"` Warnings []*ValidationError `json:"warnings"` }
func (*ValidationErrors) Append ¶
func (v *ValidationErrors) Append(code string, data map[string]string, node node.ParserNode)
func (*ValidationErrors) AppendError ¶
func (v *ValidationErrors) AppendError(e *ValidationError)
func (*ValidationErrors) AppendWarning ¶ added in v0.386.1
func (v *ValidationErrors) AppendWarning(e *ValidationError)
func (*ValidationErrors) Concat ¶
func (v *ValidationErrors) Concat(verrs ValidationErrors)
func (ValidationErrors) Error ¶
func (v ValidationErrors) Error() string
func (*ValidationErrors) ErrorsToAnnotatedSchema ¶ added in v0.386.1
func (verrs *ValidationErrors) ErrorsToAnnotatedSchema(sources []*reader.SchemaFile) string
ErrorsToAnnotatedSchema formats the validation errors by pointing to the relevant line in the source file that produced the error
The output is formatted using ANSI colours (if supported by the environment).
func (ValidationErrors) HasErrors ¶ added in v0.386.1
func (v ValidationErrors) HasErrors() bool
func (ValidationErrors) HasWarnings ¶ added in v0.386.1
func (v ValidationErrors) HasWarnings() bool
func (*ValidationErrors) ToAnnotatedSchema ¶
func (verrs *ValidationErrors) ToAnnotatedSchema(sources []*reader.SchemaFile) string
ToAnnotatedSchema formats both the validation errors and warnings by pointing to the relevant line in the source file that produced the error
The output is formatted using ANSI colours (if supported by the environment).
func (ValidationErrors) Warning ¶ added in v0.386.1
func (v ValidationErrors) Warning() string
func (*ValidationErrors) WarningsToAnnotatedSchema ¶ added in v0.386.1
func (verrs *ValidationErrors) WarningsToAnnotatedSchema(sources []*reader.SchemaFile) string
WarningsToAnnotatedSchema formats the validation warnings by pointing to the relevant line in the source file that produced the error
The output is formatted using ANSI colours (if supported by the environment).