Validation errors - ocariot/api-gateway GitHub Wiki

Invalid ID

Pattern Error

{
  "code": 400,
  "message": "Parameter {resourcename_id} is not in valid format!",
  "description": "A 24-byte hex ID similar to this: 507f191e810c19729de860ea is expected."
}

The ID parameter patterns currently used are:

  • application_id
  • child_id
  • group_id
  • educator_id
  • family_id
  • healthprofessional_id
  • institution_id
  • user_id
  • bodyfat_id
  • child_id
  • environment_id
  • institution_id
  • physicalactivity_id
  • sleep_id
  • weight_id

Invalid ID of Data Sync Agent

Pattern Error

{
  "code": 400,
  "message": "Some ID provided does not have a valid format!",
  "description": "A 24-byte hex ID similar to this: 507f191e810c19729de860ea is expected."
}

Invalid JSON format

Pattern error

{
  "code": 400,
  "message": "Unable to process request body.",
  "description": "Please verify that the JSON provided in the request body has a valid format and try again."
}

Missing fields

Pattern error

{
  "code": 400,
  "message": "Required fields were not provided...",
  "description": "{comma separated fields} are required!"
}

Empty string

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "{field name} must have at least one character!"
}

Invalid string

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "{field name} must be a string!"
}

Invalid date

Pattern error

{
  "code": 400,
  "message": "Datetime: {datetime}, is not in valid ISO 8601 format.",
  "description": "Date must be in the format: yyyy-MM-dd'T'HH:mm:ssZ"
}    

Negative number

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "{field name} can't be negative!"
}

Invalid number

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "{field name} must be a valid number!"
}

Unregistered institution

Pattern error

{
  "code": 400,
  "message": "The institution provided does not have a registration.",
  "description": "It is necessary that the institution be registered before trying again."
}

Unregistered children

Pattern error

{
  "code": 400,
  "message": "It is necessary for children to be registered before proceeding.",
  "description": "The following IDs were verified without registration: {UNREGISTERED_CHILD_IDS}"
}

Invalid children attribute type

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "children must be an array!"
}

Invalid children items

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "Children field contains invalid IDs. It is expected that each item in the array is a 24-byte hex string like this: 507f191e810c19729de860ea"
}

Empty ID(s) in children attribute

Pattern error

{
  "code": 400,
  "message": "Required fields were not provided...",
  "description": "Collection with children IDs (ID can not be empty) is required!"
}

ID(s) with invalid format in children

Pattern error

{
  "code": 400,
  "message": "One or more request fields are invalid...",
  "description": "The following IDs from children attribute are not in valid format: {INVALID_CHILD_IDS}"
}

Attempting to update password on wrong route

Pattern error

{
  "code": 400,
  "message": "This parameter could not be updated.",
  "description": "A specific route to update user password already exists.Access: PATCH /users/5db052a6fcfefe5c3de20498/password to update your password."
}

Child does not exist

Pattern error

{
  "code": 400,
  "message": "There is no registered Child with ID: {child_id} on the platform!",
  "description": "Please register the Child and try again..."
}

Institution does not exist

Pattern error

{
  "code": 400,
  "message": "There is no registered Institution with ID: {institution_id} on the platform!",
  "description": "Please register the Institution and try again..."
}