srbhr/Resume-Matcher · warning · HTTPException
No job descriptions provided
Error message
No job descriptions provided
What it means
A 400 Bad Request from upload_job_descriptions when the request body's job_descriptions field is missing, null, or an empty array. The endpoint requires at least one job description string to store for later resume tailoring.
Source
Thrown at apps/backend/app/routers/jobs.py:19
"""Job description management endpoints."""
from fastapi import APIRouter, HTTPException
from app.database import db
from app.schemas import JobUploadRequest, JobUploadResponse
router = APIRouter(prefix="/jobs", tags=["Jobs"])
@router.post("/upload", response_model=JobUploadResponse)
async def upload_job_descriptions(request: JobUploadRequest) -> JobUploadResponse:
"""Upload one or more job descriptions.
Stores the raw text for later use in resume tailoring.
Returns an array of job_ids corresponding to the input array.
"""
if not request.job_descriptions:
raise HTTPException(status_code=400, detail="No job descriptions provided")
job_ids = []
for jd in request.job_descriptions:
if not jd.strip():
raise HTTPException(status_code=400, detail="Empty job description")
job = await db.create_job(
content=jd.strip(),
resume_id=request.resume_id,
)
job_ids.append(job["job_id"])
return JobUploadResponse(
message="data successfully processed",
job_id=job_ids,
request={
"job_descriptions": request.job_descriptions,
"resume_id": request.resume_id,View on GitHub (pinned to 116f9cc3b0)
Solutions
- Include at least one non-empty string in the job_descriptions array before calling the endpoint
- Fix client-side splitting/filtering so blank text isn't reduced to an empty array
- Return a clear client-side validation error before sending the request
Example fix
// before
await api.post('/jobs/upload', { job_descriptions: texts.filter(Boolean) });
// after: guard client-side
const cleaned = texts.map(t => t.trim()).filter(Boolean);
if (cleaned.length === 0) throw new ValidationError('At least one job description is required');
await api.post('/jobs/upload', { job_descriptions: cleaned, resume_id }); Defensive patterns
Strategy: validation
Validate before calling
function validateJobUpload(body) {
const jds = (body.job_descriptions ?? []).map(s => String(s).trim()).filter(Boolean);
if (jds.length === 0) throw new ValidationError('job_descriptions must contain at least one non-empty string');
return { ...body, job_descriptions: jds };
} Type guard
function hasJobDescriptions(b) {
return Array.isArray(b?.job_descriptions) && b.job_descriptions.length > 0;
} Try / catch
try {
await api.post('/jobs/upload', body);
} catch (e) {
if (e.response?.status === 400 && e.response.data?.detail === 'No job descriptions provided') {
showFormError('Please paste at least one job description.');
} else throw e;
} Prevention
- Validate the form field is non-empty before submit
- Don't strip empty arrays from the serialized request body
- Split pasted multi-job text and check at least one segment survives filtering
- Mirror backend validation client-side for fast feedback
When it happens
Trigger: POSTing a JobUploadRequest with job_descriptions omitted, set to null, or set to []; sending a body that fails to include the field the client-side serializer dropped (e.g. empty arrays stripped).
Common situations: Client builds the payload from a textarea split that yields an empty list after filtering; a form submitted without pasting any job text; API consumers testing the endpoint with {} as the body.
Related errors
- Empty job description
- Unsupported provider: {provider}. Supported: {SUPPORTED_PROV
- Could not update the resume draft.
- ${message = data.detail or Failed to update LLM config (stat
- ${data.detail || Failed to update feature config (status ${r
AI-assisted analysis of srbhr/Resume-Matcher@116f9cc3b0 (2026-08-28).
Data as JSON: /api/errors/bdfc9c29d5b74569.
Report an issue: GitHub.