Skip to content

Commit

Permalink
golint: add GoDoc for exported types and functions
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah authored and johandorland committed Apr 18, 2019
1 parent 7bb655a commit 5fcca16
Show file tree
Hide file tree
Showing 12 changed files with 320 additions and 45 deletions.
2 changes: 2 additions & 0 deletions draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import (
"github.com/xeipuuv/gojsonreference"
)

// Draft is a JSON-schema draft version
type Draft int

// Supported Draft versions
const (
Draft4 Draft = 4
Draft6 Draft = 6
Expand Down
93 changes: 62 additions & 31 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,157 +16,188 @@ type errorTemplate struct {
}

type (
// RequiredError. ErrorDetails: property string
// RequiredError indicates that a required field is missing
// ErrorDetails: property string
RequiredError struct {
ResultErrorFields
}

// InvalidTypeError. ErrorDetails: expected, given
// InvalidTypeError indicates that a field has the incorrect type
// ErrorDetails: expected, given
InvalidTypeError struct {
ResultErrorFields
}

// NumberAnyOfError. ErrorDetails: -
// NumberAnyOfError is produced in case of a failing "anyOf" validation
// ErrorDetails: -
NumberAnyOfError struct {
ResultErrorFields
}

// NumberOneOfError. ErrorDetails: -
// NumberOneOfError is produced in case of a failing "oneOf" validation
// ErrorDetails: -
NumberOneOfError struct {
ResultErrorFields
}

// NumberAllOfError. ErrorDetails: -
// NumberAllOfError is produced in case of a failing "allOf" validation
// ErrorDetails: -
NumberAllOfError struct {
ResultErrorFields
}

// NumberNotError. ErrorDetails: -
// NumberNotError is produced if a "not" validation failed
// ErrorDetails: -
NumberNotError struct {
ResultErrorFields
}

// MissingDependencyError. ErrorDetails: dependency
// MissingDependencyError is produced in case of a "missing dependency" problem
// ErrorDetails: dependency
MissingDependencyError struct {
ResultErrorFields
}

// InternalError. ErrorDetails: error
// InternalError indicates an internal error
// ErrorDetails: error
InternalError struct {
ResultErrorFields
}

// ConstError. ErrorDetails: allowed
// ConstError indicates a const error
// ErrorDetails: allowed
ConstError struct {
ResultErrorFields
}

// EnumError. ErrorDetails: allowed
// EnumError indicates an enum error
// ErrorDetails: allowed
EnumError struct {
ResultErrorFields
}

// ArrayNoAdditionalItemsError. ErrorDetails: -
// ArrayNoAdditionalItemsError is produced if additional items were found, but not allowed
// ErrorDetails: -
ArrayNoAdditionalItemsError struct {
ResultErrorFields
}

// ArrayMinItemsError. ErrorDetails: min
// ArrayMinItemsError is produced if an array contains less items than the allowed minimum
// ErrorDetails: min
ArrayMinItemsError struct {
ResultErrorFields
}

// ArrayMaxItemsError. ErrorDetails: max
// ArrayMaxItemsError is produced if an array contains more items than the allowed maximum
// ErrorDetails: max
ArrayMaxItemsError struct {
ResultErrorFields
}

// ItemsMustBeUniqueError. ErrorDetails: type, i, j
// ItemsMustBeUniqueError is produced if an array requires unique items, but contains non-unique items
// ErrorDetails: type, i, j
ItemsMustBeUniqueError struct {
ResultErrorFields
}

// ArrayContainsError. ErrorDetails:
// ArrayContainsError is produced if an array contains invalid items
// ErrorDetails:
ArrayContainsError struct {
ResultErrorFields
}

// ArrayMinPropertiesError. ErrorDetails: min
// ArrayMinPropertiesError is produced if an object contains less properties than the allowed minimum
// ErrorDetails: min
ArrayMinPropertiesError struct {
ResultErrorFields
}

// ArrayMaxPropertiesError. ErrorDetails: max
// ArrayMaxPropertiesError is produced if an object contains more properties than the allowed maximum
// ErrorDetails: max
ArrayMaxPropertiesError struct {
ResultErrorFields
}

// AdditionalPropertyNotAllowedError. ErrorDetails: property
// AdditionalPropertyNotAllowedError is produced if an object has additional properties, but not allowed
// ErrorDetails: property
AdditionalPropertyNotAllowedError struct {
ResultErrorFields
}

// InvalidPropertyPatternError. ErrorDetails: property, pattern
// InvalidPropertyPatternError is produced if an pattern was found
// ErrorDetails: property, pattern
InvalidPropertyPatternError struct {
ResultErrorFields
}

// InvalidPopertyNameError. ErrorDetails: property
// InvalidPropertyNameError is produced if an invalid-named property was found
// ErrorDetails: property
InvalidPropertyNameError struct {
ResultErrorFields
}

// StringLengthGTEError. ErrorDetails: min
// StringLengthGTEError is produced if a string is shorter than the minimum required length
// ErrorDetails: min
StringLengthGTEError struct {
ResultErrorFields
}

// StringLengthLTEError. ErrorDetails: max
// StringLengthLTEError is produced if a string is longer than the maximum allowed length
// ErrorDetails: max
StringLengthLTEError struct {
ResultErrorFields
}

// DoesNotMatchPatternError. ErrorDetails: pattern
// DoesNotMatchPatternError is produced if a string does not match the defined pattern
// ErrorDetails: pattern
DoesNotMatchPatternError struct {
ResultErrorFields
}

// DoesNotMatchFormatError. ErrorDetails: format
// DoesNotMatchFormatError is produced if a string does not match the defined format
// ErrorDetails: format
DoesNotMatchFormatError struct {
ResultErrorFields
}

// MultipleOfError. ErrorDetails: multiple
// MultipleOfError is produced if a number is not a multiple of the defined multipleOf
// ErrorDetails: multiple
MultipleOfError struct {
ResultErrorFields
}

// NumberGTEError. ErrorDetails: min
// NumberGTEError is produced if a number is lower than the allowed minimum
// ErrorDetails: min
NumberGTEError struct {
ResultErrorFields
}

// NumberGTError. ErrorDetails: min
// NumberGTError is produced if a number is lower than, or equal to the specified minimum, and exclusiveMinimum is set
// ErrorDetails: min
NumberGTError struct {
ResultErrorFields
}

// NumberLTEError. ErrorDetails: max
// NumberLTEError is produced if a number is higher than the allowed maximum
// ErrorDetails: max
NumberLTEError struct {
ResultErrorFields
}

// NumberLTError. ErrorDetails: max
// NumberLTError is produced if a number is higher than, or equal to the specified maximum, and exclusiveMaximum is set
// ErrorDetails: max
NumberLTError struct {
ResultErrorFields
}

// ConditionThenError. ErrorDetails: -
// ConditionThenError is produced if a condition's "then" validation is invalid
// ErrorDetails: -
ConditionThenError struct {
ResultErrorFields
}

// ConditionElseError. ErrorDetails: -
// ConditionElseError is produced if a condition's "else" condition is invalid
// ErrorDetails: -
ConditionElseError struct {
ResultErrorFields
}
Expand Down
Loading

0 comments on commit 5fcca16

Please sign in to comment.