Skip to content

Commit c4bc31a

Browse files
committed
docs(README): update API examples to use camelCase JSON keys
- Update Create Item, Update Item by ID, and Update Display Settings examples to use camelCase JSON keys. - Clarify that request bodies should use camelCase keys for better consistency with modern JSON API conventions.
1 parent 4309be1 commit c4bc31a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ This endpoint serves as the single entry point for accessing different data mode
9797
2. **Create Item**
9898
* **Method:** `POST`
9999
* **Path:** `/api/v1/data?model=<model_name>`
100-
* **Request Body:** JSON object representing the item to create.
100+
* **Request Body:** JSON object representing the item to create (using `camelCase` keys).
101101
* **Success Response:** `201 Created` with `SuccessApiResponse<T>` containing the created item.
102-
* **Example:** `POST /api/v1/data?model=category` with body `{"name": "Sports", ...}`
102+
* **Example:** `POST /api/v1/data?model=category` with body `{"name": "Sports", "description": "News about sports"}`
103103

104104
3. **Get Item by ID**
105105
* **Method:** `GET`
@@ -111,10 +111,10 @@ This endpoint serves as the single entry point for accessing different data mode
111111
4. **Update Item by ID**
112112
* **Method:** `PUT`
113113
* **Path:** `/api/v1/data/<item_id>?model=<model_name>`
114-
* **Request Body:** JSON object representing the complete updated item (must include `id`).
114+
* **Request Body:** JSON object representing the complete updated item (must include `id`, using `camelCase` keys).
115115
* **Success Response:** `200 OK` with `SuccessApiResponse<T>`.
116116
* **Error Response:** `404 Not Found`, `400 Bad Request`.
117-
* **Example:** `PUT /api/v1/data/some-category-id?model=category` with updated category JSON.
117+
* **Example:** `PUT /api/v1/data/some-category-id?model=category` with updated category JSON (e.g., `{"id": "...", "name": "...", "description": "..."}`).
118118

119119
5. **Delete Item by ID**
120120
* **Method:** `DELETE`
@@ -140,9 +140,9 @@ These endpoints manage application settings. Currently, they operate on a global
140140
2. **Update Display Settings**
141141
* **Method:** `PUT`
142142
* **Path:** `/api/v1/users/me/settings/display`
143-
* **Request Body:** JSON object representing the complete `DisplaySettings`.
143+
* **Request Body:** JSON object representing the complete `DisplaySettings` (using `camelCase` keys).
144144
* **Success Response:** `200 OK` with `SuccessApiResponse<DisplaySettings>` containing the updated settings.
145-
* **Example:** `PUT /api/v1/users/me/settings/display` with `DisplaySettings` JSON in the body.
145+
* **Example:** `PUT /api/v1/users/me/settings/display` with body `{"baseTheme": "dark", "accentTheme": "newsRed", ...}`.
146146

147147
3. **Get Language Setting**
148148
* **Method:** `GET`

0 commit comments

Comments
 (0)