Skip to content

fix(diarychat): move base path to /api/v1/diary-chatrooms (Spring ambiguous mapping startup fix)#42

Open
rivkode wants to merge 1 commit into
devfrom
fix/diary-chatroom-path-conflict
Open

fix(diarychat): move base path to /api/v1/diary-chatrooms (Spring ambiguous mapping startup fix)#42
rivkode wants to merge 1 commit into
devfrom
fix/diary-chatroom-path-conflict

Conversation

@rivkode
Copy link
Copy Markdown
Owner

@rivkode rivkode commented Apr 25, 2026

Summary

PR #41(diary chatroom v1)이 머지된 직후 앱 부팅 시 다음 에러가 발생했습니다:

```
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'requestMappingHandlerMapping' ...
Ambiguous mapping. Cannot map 'diaryChatRoomController' method
... DiaryChatRoomController#create(...)
to {POST [/api/v1/chatrooms]}: There is already 'chatRoomApiController' bean method
```

기존 페르소나 챗봇 도메인의 `ChatRoomApiController`가 `/api/v1/chatrooms` prefix를 이미 점유 중이라 PRD §7 spec 그대로 매핑 시 charter가 충돌합니다.

변경

  • `DiaryChatRoomController`, `DiaryChatMessageController`, `DiaryChatPollingController` 의 base path 를 `/api/v1/chatrooms` → `/api/v1/diary-chatrooms` 로 이동
  • API request/response shape 변경 없음. base path 1단어만 변경
  • PRD §7.0.1 에 spec 대비 deviation 으로 기록 (프론트가 contract base 업데이트 필요)

새 endpoint 매핑

변경 전 변경 후
`POST /api/v1/chatrooms` `POST /api/v1/diary-chatrooms`
`GET /api/v1/chatrooms/{id}` `GET /api/v1/diary-chatrooms/{id}`
`GET /api/v1/chatrooms/{id}/participants` `GET /api/v1/diary-chatrooms/{id}/participants`
`POST /api/v1/chatrooms/{id}/join` `POST /api/v1/diary-chatrooms/{id}/join`
`POST /api/v1/chatrooms/{id}/leave` `POST /api/v1/diary-chatrooms/{id}/leave`
`POST /api/v1/chatrooms/{id}/ai-toggle` `POST /api/v1/diary-chatrooms/{id}/ai-toggle`
`GET/POST /api/v1/chatrooms/{id}/messages` `GET/POST /api/v1/diary-chatrooms/{id}/messages`
`GET /api/v1/chatrooms/{id}/messages/poll` `GET /api/v1/diary-chatrooms/{id}/messages/poll`

Test plan

🤖 Generated with Claude Code

…rsona-chat collision

PR #41 wired the diary chatroom controllers under /api/v1/chatrooms
but that prefix was already owned by ChatRoomApiController (persona
chat domain), so Spring failed to start with:

  Ambiguous mapping. Cannot map 'diaryChatRoomController' method
  ... to {POST [/api/v1/chatrooms]}: There is already
  'chatRoomApiController' bean method ...

- DiaryChatRoom/Message/Polling controllers now mount under
  /api/v1/diary-chatrooms (and .../{roomId}/messages, .../poll)
- API shape and request/response bodies are unchanged; only the base
  path moves
- PRD §7.0.1 records the rename as a documented spec deviation so the
  frontend updates the contract base accordingly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant