Skip to content

Conversation

@Sachindu-Nethmin
Copy link
Contributor

@Sachindu-Nethmin Sachindu-Nethmin commented Dec 9, 2025

Purpose

Add HTTP REST API for Hotel Room Reservation use case and related images

Summary by CodeRabbit

  • Documentation
    • Updated Developer Guides navigation for Migration Tools resources.
    • Added new use case guide: Build an HTTP REST API for Hotel Reservation, featuring API design principles, setup instructions, endpoint specifications, data models, and example test workflows using curl.

✏️ Tip: You can customize this high-level summary in your review settings.

Update Migration Tools link to point to the overview page
Add HTTP REST API for Hotel Room Reservation use case and related images
Enhance HTTP REST API documentation with additional configuration details and new resource images
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Navigation links updated in documentation indexes to point to migration tools overview. New documentation guide added for building HTTP REST APIs for hotel reservations using WSO2 Integrator, including resource definitions, endpoint specifications, and implementation workflow.

Changes

Cohort / File(s) Change Summary
Navigation Updates
en/docs/index.md, en/mkdocs.yml
Updated Developer Guides navigation link to point to migration tools overview page; added new navigation entry for HTTP REST API hotel reservation use case under Data Mapper
New Documentation
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md
Added comprehensive guide for building Level 3 REST API with HATEOAS for hotel reservation system, including data types, endpoints, response structures, prerequisites, project setup, and curl-based testing workflow

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Documentation updates are straightforward with no code logic complexity
  • Navigation changes are minor and self-evident
  • New guide file is content-heavy but follows standard documentation structure with no intricate technical logic requiring deep analysis

Poem

🐰 A new hotel awaits in the API night,
With REST and HATEOAS shining bright,
We've mapped the paths and links so true,
Doc updates made, both old and new! 🏨✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete, providing only a Purpose section while missing most required sections like Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Tests, Security checks, Samples, and Test environment. Expand the description to include all required sections from the template, particularly Goals, Approach, Release note, and Documentation sections to provide comprehensive context for reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an HTTP REST API documentation for a hotel room reservation use case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md (2)

168-169: Standardize heading style: use atx (###) instead of setext.

Line 168 uses a setext-style heading (underline with dashes), which is inconsistent with the atx-style headers (##) used elsewhere in the document.

Replace the setext heading with the atx style:

-### Edit reservation resource (PUT)
-
-1. **Resource Path**: `reservations/[string id]`
+### Edit reservation resource (PUT)

-1. **Resource Path**: `reservations/[string id]`

175-185: Standardize resource path notation for consistency.

Line 177 uses reservations/[string id] notation for path parameters, while earlier examples (line 20) use the standard REST convention {id}. Use curly braces consistently throughout.

Apply this diff to align with standard REST notation:

-1. **Resource Path**: `reservations/[string id]`
+1. **Resource Path**: `reservations/{id}`

Then apply the same change to line 183 (reservations/[string id]reservations/{id}).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32f5957 and f8a725a.

📒 Files selected for processing (2)
  • en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md (1 hunks)
  • en/mkdocs.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • en/mkdocs.yml
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md

58-58: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


67-67: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


81-81: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


92-92: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


104-104: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


168-168: Heading style
Expected: atx; Actual: setext

(MD003, heading-style)


198-198: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


217-217: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


236-236: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


265-265: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🔇 Additional comments (2)
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md (2)

1-345: Content structure and comprehensiveness look solid.

The documentation provides a well-organized, step-by-step guide with clear explanations of REST principles, practical examples, and a realistic hotel reservation workflow. The use of JSON examples, curl commands, and accompanying GIFs enhances understanding.


45-45: Verify image asset paths exist in documentation output.

The document references GIF images at lines 45, 113, 150, 168, and 187 using the path pattern {{base_path}}/assets/usecases/http-reservation/img/. Ensure these image files exist in the assets directory, or the documentation links will break.

Comment on lines +58 to +112
**Type: Location**
```json
{
"name": "Alps Resort",
"id": "l1000",
"address": "123 Mountain Road, Switzerland"
}
```

**Type: Room**
```json
{
"id": "r1000",
"category": "DELUXE",
"capacity": 5,
"wifi": true,
"status": "AVAILABLE",
"currency": "USD",
"price": 200.00,
"count": 3
}
```

**Type: ReservationRequest**
```json
{
"reserveRooms": [
{"id": "r1000", "count": 2}
],
"startDate": "2025-08-01",
"endDate": "2025-08-03"
}
```

**Type: ReservationReceipt**
```json
{
"id": "re1000",
"expiryDate": "2025-07-01",
"lastUpdated": "2025-06-29T13:01:30Z",
"currency": "USD",
"total": 400.00,
"state": "VALID"
}
```

**Type: Payment**
```json
{
"cardNumber": "1234567890123456",
"expiryDate": "12/27",
"cvv": "123"
}
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Fix markdown formatting: use headings instead of emphasis for data type definitions.

Lines 58, 67, 81, 92, and 104 use bold text (**Type: ...**) instead of proper markdown headers. This affects document structure and linting compliance.

Apply this diff to use proper markdown headers:

-**Type: Location**
+### Type: Location

Then apply the same pattern to lines 67 (**Type: Room**), 81 (**Type: ReservationRequest**), 92 (**Type: ReservationReceipt**), and 104 (**Type: Payment**).

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

58-58: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


67-67: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


81-81: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


92-92: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


104-104: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🤖 Prompt for AI Agents
In
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md
around lines 58 to 112, the data type labels currently use bold formatting
(e.g., **Type: Location**) which breaks document structure and linting; replace
each bold label at lines 58, 67, 81, 92, and 104 with a proper markdown header
(for example a level-3 header like ### Type: Location) so each type is a real
heading, leaving the JSON blocks unchanged and ensuring consistent header level
for all five occurrences.

Comment on lines +198 to +284
**1. Start at the entry point**

```bash
curl http://localhost:8290/hotel/locations
```

Response includes link to rooms:
```json
{
"locations": [...],
"_links": {
"room": {
"href": "/hotel/locations/{id}/rooms",
"methods": ["GET"]
}
}
}
```

**2. Follow the "room" link**

```bash
curl "http://localhost:8290/hotel/locations/l1000/rooms?startDate=2025-08-01&endDate=2025-08-03"
```

Response includes link to make reservation:
```json
{
"rooms": [...],
"_links": {
"reservation": {
"href": "/hotel/reservations",
"methods": ["POST"]
}
}
}
```

**3. Follow the "reservation" link**

```bash
curl -X POST http://localhost:8290/hotel/reservations \
-H "Content-Type: application/json" \
-d '{
"reserveRooms": [{"id": "r1000", "count": 2}],
"startDate": "2025-08-01",
"endDate": "2025-08-03"
}'
```

Response includes links to cancel, edit, or pay:
```json
{
"id": "re1000",
"total": 400.00,
"state": "VALID",
"_links": {
"cancel": {...},
"edit": {...},
"payment": {
"href": "/hotel/payments/re1000",
"methods": ["POST"]
}
}
}
```

**4. Follow the "payment" link to complete**

```bash
curl -X POST http://localhost:8290/hotel/payments/re1000 \
-H "Content-Type: application/json" \
-d '{
"cardNumber": "1234567890123456",
"expiryDate": "12/27",
"cvv": "123"
}'
```

Response has no links (workflow complete):
```json
{
"id": "p1000",
"total": 400.00,
"rooms": [{"id": "r1000", "status": "RESERVED"}]
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Fix markdown formatting: use headings for test workflow section headers.

Lines 198, 217, 236, and 265 use bold text (**1. Start at the entry point**, etc.) instead of proper markdown headers for subsection titles.

Replace emphasis with markdown headers:

-**1. Start at the entry point**
+### 1. Start at the entry point

Apply the same pattern to lines 217 (**2. Follow the "room" link**), 236 (**3. Follow the "reservation" link**), and 265 (**4. Follow the "payment" link to complete**).

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

198-198: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


217-217: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


236-236: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


265-265: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

🤖 Prompt for AI Agents
In
en/docs/integration-guides/usecases/http/build-an-http-rest-api-for-hotel-reservation.md
around lines 198 to 284, the subsection titles currently use bolded text (e.g.,
"**1. Start at the entry point**") instead of markdown headers; replace those
bold lines at 198, 217, 236, and 265 with appropriate markdown headers (e.g.,
"### 1. Start at the entry point", "### 2. Follow the \"room\" link", "### 3.
Follow the \"reservation\" link", "### 4. Follow the \"payment\" link to
complete") so they render as section headings while keeping the surrounding code
blocks and example JSON unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants