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) Concat(verrs ValidationErrors)
- func (v ValidationErrors) Error() string
- func (verrs *ValidationErrors) ToAnnotatedSchema(sources []reader.SchemaFile) string
- func (e ValidationErrors) Unwrap() error
Constants ¶
View Source
const ( ErrorUpperCamel = "E001" ErrorActionNameLowerCamel = "E002" ErrorFieldNamesUniqueInModel = "E003" ErrorActionUniqueGlobally = "E004" ErrorInvalidActionInput = "E005" ErrorReservedFieldName = "E006" ErrorActionMissingUniqueInput = "E008" 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" ErrorForbiddenValueCondition = "E023" ErrorIncorrectArguments = "E024" ErrorInvalidSyntax = "E025" ErrorExpressionTypeMismatch = "E026" ErrorForbiddenOperator = "E027" ErrorNonBooleanValueCondition = "E028" ErrorExpressionArrayMismatchingOperator = "E030" ErrorExpressionForbiddenArrayLHS = "E031" ErrorExpressionMixedTypesInArrayLiteral = "E032" ErrorCreateActionNoInputs = "E033" ErrorCreateActionMissingInput = "E034" ErrorActionInputNotUnique = "E035" ErrorActionWhereNotUnique = "E036" ErrorNonDirectComparisonOperatorUsed = "E037" ErrorUnusedInput = "E038" ErrorInvalidOneToOneRelationship = "E039" ErrorInvalidActionType = "E040" ErrorModelNotAllowedAsInput = "E041" ErrorReservedActionName = "E042" ErrorClashingImplicitInput = "E043" ErrorMissingRelationshipField = "E044" ErrorAmbiguousRelationship = "E045" ErrorCreateActionMissingInputAliases = "E046" ErrorModelNotFound = "E047" ErrorExpressionFieldTypeMismatch = "E048" ErrorExpressionMultipleConditions = "E049" ErrorDefaultExpressionNeeded = "E050" ErrorDefaultExpressionOperatorPresent = "E051" ErrorRelationAttrOnWrongFieldType = "E052" ErrorRelationAttrOnNonRepeatedField = "E053" ErrorRelationAttributShouldBeIdentifier = "E054" ErrorRelationAttributeUnrecognizedField = "E055" ErrorRelationAttributeRelatedFieldWrongType = "E056" ErrorRelationAttributeRelatedFieldIsNotRepeated = "E057" ErrorRelationAttributeRelatedFieldIsDuplicated = "E058" 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" )
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"`
}
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) Concat ¶
func (v *ValidationErrors) Concat(verrs ValidationErrors)
func (ValidationErrors) Error ¶
func (v ValidationErrors) Error() string
func (*ValidationErrors) ToAnnotatedSchema ¶
func (verrs *ValidationErrors) ToAnnotatedSchema(sources []reader.SchemaFile) string
ToAnnotatedSchema 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) Unwrap ¶
func (e ValidationErrors) Unwrap() error
Click to show internal directories.
Click to hide internal directories.