Skip to content

Missing invalid_request_parameters code in ClientError #422

@mcantrell

Description

@mcantrell

Description of the issue

The API can return errors with invalid ClientError json which contains an invalid code: invalid_request_parameters. This is not a member of the expected enum.

To create the erroneous error, you can use the Collaborations API with an invalid notify query param (uses 1 instead of true):

curl -s -X POST "https://api.box.com/2.0/collaborations?notify=1" \
     -H "authorization: Bearer ${ACCESS_TOKEN}" \
     -H "content-type: application/json" \
     -d @./scripts/payloads/collaborate-folder.json | jq
{
  "type": "error",
  "status": 400,
  "code": "invalid_request_parameters",
  "help_url": "http://developers.box.com/docs/#errors",
  "message": "Invalid input parameters in request",
  "request_id": "ffhfc9hpkud5li85"
}

This can cause issues de-serializing the response in some generated clients.

Current content

#/components/schemas/ClientError

"code": {
    "description": "A Box-specific error code",
    "example": "item_name_invalid",
    "type": "string",
    "enum": [
        "created",
        "accepted",
        "no_content",
        "redirect",
        "not_modified",
        "bad_request",
        "unauthorized",
        "forbidden",
        "not_found",
        "method_not_allowed",
        "conflict",
        "precondition_failed",
        "too_many_requests",
        "internal_server_error",
        "unavailable",
        "item_name_invalid",
        "insufficient_scope"
    ]
}

Expected content

#/components/schemas/ClientError

"code": {
    "description": "A Box-specific error code",
    "example": "item_name_invalid",
    "type": "string",
    "enum": [
        "created",
        "accepted",
        "no_content",
        "redirect",
        "not_modified",
        "bad_request",
        "unauthorized",
        "forbidden",
        "not_found",
        "method_not_allowed",
        "conflict",
        "precondition_failed",
        "too_many_requests",
        "internal_server_error",
        "unavailable",
        "item_name_invalid",
        "insufficient_scope",
       "invalid_request_parameters"
    ]
}

Link to the documentation page

No response

Metadata

Metadata

Assignees

Labels

documentationError found at Box Developer Documentation site

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions