Package

org.scalatra

validation

Permalink

package validation

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. validation
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait ErrorCode extends AnyRef

    Permalink

    A base trait for error codes, all error codes need to extend this.

    A base trait for error codes, all error codes need to extend this. It's available for you so you can add more in your app

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  2. class ErrorCodeSerializer extends Serializer[ErrorCode]

    Permalink

    Assumes your error codes will always be case objects.

    Assumes your error codes will always be case objects.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  3. case class FieldName(name: String) extends Product with Serializable

    Permalink

    Encapsulates a field name for use in a validation error

    Encapsulates a field name for use in a validation error

    name

    The name of the field

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  4. case class ValidationError(message: String, field: Option[FieldName], code: Option[ErrorCode], args: Seq[Any]) extends Product with Serializable

    Permalink

    Encapsulates errors in an API

    Encapsulates errors in an API

    message

    The message for this error

    field

    An optional field name, useful when it applies to a particular field

    code

    Decouple business logic error types from http errors

    args

    Optional args, these need to be serializable to json if you're using the org.scalatra.validation.ValidationErrorSerializer

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  5. class ValidationErrorSerializer extends CustomSerializer[ValidationError]

    Permalink

    Serializes a validation error into a structure:

      {
        "message": "the error message",
        "field": "field_name",
        "code": "ValidationFail",
        "args": []
      }
    

    Serializes a validation error into a structure:

      {
        "message": "the error message",
        "field": "field_name",
        "code": "ValidationFail",
        "args": []
      }
    

    You can configure whether or not to include the args. And on the way in it assumes args are JValues. The fields: field, code and args are only added if they have actual data.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

Deprecated Value Members

  1. object BadGateway extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  2. object GatewayTimeout extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  3. object NotFound extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  4. object NotImplemented extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  5. object ServiceUnavailable extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  6. object UnknownError extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  7. object Validation

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  8. object ValidationError extends Serializable

    Permalink

    Allows for unordered building of org.scalatra.validation.ValidationError

    Allows for unordered building of org.scalatra.validation.ValidationError

    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  9. object ValidationFail extends ErrorCode with Product with Serializable

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

  10. object Validators

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use scalatra-forms instead.

Inherited from AnyRef

Inherited from Any

Ungrouped