-
Notifications
You must be signed in to change notification settings - Fork 610
fix: zen body binding #3810
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
Merged
Merged
fix: zen body binding #3810
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f2d80c0
remove metrics
Flo4604 a0b664b
fix: body reading
Flo4604 5bf34d0
fix: allow logging on handler level
Flo4604 08c3b97
rabbit comment
Flo4604 8f0ff3a
rabbit comment
Flo4604 f594caf
fix for comments
Flo4604 872c2f1
add docs and fix http status code
Flo4604 d2038bd
[autofix.ci] apply automated fixes
autofix-ci[bot] 53f98bb
Merge branch 'main' into fix/zen_body_binding
Flo4604 b107161
fix: openapi content header
Flo4604 22901eb
Merge branch 'main' into fix/zen_body_binding
Flo4604 00c333f
adjust for comments
Flo4604 503f6bf
Merge branch 'main' into fix/zen_body_binding
Flo4604 cf319da
Merge branch 'main' into fix/zen_body_binding
Flo4604 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
apps/docs/errors/user/bad_request/request_body_too_large.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| title: "request_body_too_large" | ||
| description: "Request body exceeds the maximum allowed size limit" | ||
| --- | ||
|
|
||
| <Danger>`err:user:bad_request:request_body_too_large`</Danger> | ||
|
|
||
| ```json Example | ||
| { | ||
| "meta": { | ||
| "requestId": "req_4dgzrNP3Je5mU1tD" | ||
| }, | ||
| "error": { | ||
| "detail": "The request body exceeds the maximum allowed size of 100 bytes.", | ||
| "status": 413, | ||
| "title": "Request Entity Too Large", | ||
| "type": "https://unkey.com/docs/errors/user/bad_request/request_body_too_large", | ||
| "errors": [] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## What Happened? | ||
|
|
||
| Your request was too big! We limit how much data you can send in a single API request to keep everything running smoothly. | ||
|
|
||
| This usually happens when you're trying to send a lot of data at once - like huge metadata objects or really long strings in your request. | ||
|
|
||
| ## How to Fix It | ||
|
|
||
| ### 1. Trim Down Your Request | ||
|
|
||
| The most common cause is putting too much data in the `meta` field or other parts of your request. | ||
|
|
||
| <CodeGroup> | ||
Flo4604 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```bash Too Big | ||
| curl -X POST https://api.unkey.com/v2/keys.create \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer unkey_XXXX" \ | ||
| -d '{ | ||
| "apiId": "api_123", | ||
| "name": "My Key", | ||
| "meta": { | ||
| "userProfile": "... really long user profile data ...", | ||
| "settings": { /* huge nested object with tons of properties */ } | ||
| } | ||
| }' | ||
| ``` | ||
Flo4604 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ```bash Just Right | ||
| curl -X POST https://api.unkey.com/v2/keys.create \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Authorization: Bearer unkey_XXXX" \ | ||
| -d '{ | ||
| "apiId": "api_123", | ||
| "name": "My Key", | ||
| "meta": { | ||
| "userId": "user_123", | ||
| "tier": "premium" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| </CodeGroup> | ||
|
|
||
| ### 2. Store Big Data Elsewhere | ||
|
|
||
| Instead of cramming everything into your API request: | ||
|
|
||
| - Store large data in your own database | ||
| - Only send IDs or references to Unkey | ||
| - Fetch the full data when you need it | ||
|
|
||
| ## Need a Higher Limit? | ||
|
|
||
| <Note> | ||
| **Got a special use case?** If you have a legitimate need to send larger requests, we'd love to hear about it! | ||
|
|
||
| [Contact our support team](mailto:support@unkey.com) and include: | ||
| - What you're building | ||
| - Why you need to send large requests | ||
| - An example of the data you're trying to send | ||
|
|
||
| We'll work with you to find a solution that works for your use case. | ||
| </Note> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.