Skip to content

Commit

Permalink
📚 docs: update README.md #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Dec 14, 2024
1 parent c7e9d78 commit 583dfc0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,38 @@ import "github.com/sivaosorg/wrapify"

#### Usage

> An example of the wrapper-based standardized API response
```json
{
"data": "response body here", // The primary data payload of the response.
"debug": {
"___abc": "trace sessions_id: 4919e84fc26881e9fe790f5d07465db4",
"refer": 1234
}, // Debugging information (useful for development).
"message": "How are you? I'm good", // A message providing additional context about the response.
"meta": {
"api_version": "v0.0.1", // API version used for the request.
"custom_fields": {
"fields": "userID: 103"
}, // Additional custom metadata fields.
"locale": "en_US", // Locale used for the request, e.g., "en-US".
"request_id": "80eafc6a1655ec5a06595d155f1e6951", // Unique identifier for the request, useful for debugging.
"requested_time": "2024-12-14T20:24:23.983839+07:00" // Timestamp when the request was made.
}, // Metadata about the API response.
"pagination": {
"is_last": true, // Indicates whether this is the last page.
"page": 1000, // Current page number.
"per_page": 2, // Number of items per page.
"total_items": 120, // Total number of items available.
"total_pages": 34 // Total number of pages.
}, // Pagination details, if applicable.
"path": "/api/v1/users", // Request path for which the response is generated.
"status_code": 200, // HTTP status code for the response.
"total": 1 // Total number of items (used in non-paginated responses).
}
```

> Structure of the wrapper-based standardized API response
```go
Expand Down

0 comments on commit 583dfc0

Please sign in to comment.