convert_session_to_image endpoint uses QueryParam instead of BodyParam, failing when called with JSON body
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Same regression as BA-5496. POST /session/{session_name}/imagify handler uses QueryParam[ConvertSessionToImageRequest] instead of BodyParam.
image_name is a required field, so any client sending JSON body (e.g. WebUI) will get a validation error:
Field required [type=missing, input_value=, input_type=MultiDictProxy]
Root cause: BA-4823 (PR #9588, fc0caf8eb) bulk-changed BodyParam to QueryParam for multiple session endpoints. This was correct for GET/DELETE endpoints but incorrect for POST endpoints.
Fix:
- handler.py: Change QueryParam[ConvertSessionToImageRequest] to BodyParam[ConvertSessionToImageRequest], update query.parsed to body.parsed
- client/v2/domains/session.py: Change params= back to request= in convert_to_image method
Related: BA-5496 (rename_session — same issue)
JIRA Issue: BA-5510
Contributor guide
Research direction
Start with the POST /session/{session_name}/imagify handler in handler.py and inspect how its request is parsed. Then review client/v2/domains/session.py and the convert_to_image method. Done means JSON requests containing the required image_name field validate successfully and the client passes the request body correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100