box / box/box-openapi

Missing invalid_request_parameters code in ClientError

Open
#422 0 comments 0 reactions 1 assignee Claimed by @wsocha View on GitHub
documentation
Dominant language
No language data
Stars
101
Forks
89
Avg merge
30m
Merged PRs (30d)
3

Description

### 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):

```shell
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
```

```json
{
"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`

```json
"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`

```json
"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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.