Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing invalid_request_parameters code in ClientError #422

Open
mcantrell opened this issue May 10, 2024 · 0 comments
Open

Missing invalid_request_parameters code in ClientError #422

mcantrell opened this issue May 10, 2024 · 0 comments
Labels
documentation Error found at Box Developer Documentation site

Comments

@mcantrell
Copy link

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

@mcantrell mcantrell added the documentation Error found at Box Developer Documentation site label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Error found at Box Developer Documentation site
Projects
None yet
Development

No branches or pull requests

1 participant