Skip to content

fix: school search fails for partial names like 양정 - #11

Merged
injoon5 merged 1 commit into
mainfrom
cursor/fix-school-response-validation-dfd7
Jun 12, 2026
Merged

injoon5 merged 1 commit into
mainfrom
cursor/fix-school-response-validation-dfd7

Conversation

@injoon5

@injoon5 injoon5 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Problem

GET /school?schoolname=양정 returned a VALIDATION_ERROR even though NEIS returned valid data. The handler found 10 matching schools, but Elysia response validation rejected the payload.

Root cause: some elementary schools (e.g. 거제양정초등학교) omit HS_GNRL_BUSNS_SC_NM, which our SchoolInfoRowSchema required. Partial-name searches return mixed school types, so one missing field failed the entire response.

Fix

  • Make HS_GNRL_BUSNS_SC_NM optional in SchoolInfoRowSchema
  • Align SchoolInfoRow client type (HS_GNRL_BUSNS_SC_NM?: string | null)
  • Add regression test for partial name search 양정

Verification

  • npm test — all structural checks pass, including new partial-name case
  • npm run build
  • Local GET /school?schoolname=양정 returns 200 with 10 schools
Open in Web Open in Cursor 

NEIS omits HS_GNRL_BUSNS_SC_NM for some elementary schools (e.g.
거제양정초등학교). Partial name searches like 양정 return mixed school
types, so response validation failed even though NEIS data was valid.

Make the field optional in SchoolInfoRowSchema and add a regression test.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
school-api Building Building Preview, Comment Jun 12, 2026 6:11am
school-api-docs Building Building Preview, Comment Jun 12, 2026 6:11am

@injoon5
injoon5 marked this pull request as ready for review June 12, 2026 06:11
@injoon5
injoon5 merged commit f567603 into main Jun 12, 2026
3 of 5 checks passed

This branch was successfully deployed

2 active deployments
Preview – school-api — f30509cf Deployed Jun 12, 2026 by vercel[bot]
Preview – school-api-docs — f30509cf Deployed Jun 12, 2026 by vercel[bot]
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