Skip to content

fix: relax school response schema for sparse NEIS rows - #12

Draft
injoon5 wants to merge 1 commit into
mainfrom
cursor/fix-school-optional-fields-d5c3
Draft

fix: relax school response schema for sparse NEIS rows#12
injoon5 wants to merge 1 commit into
mainfrom
cursor/fix-school-optional-fields-d5c3

Conversation

@injoon5

@injoon5 injoon5 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Problem

GET /school?schoolname=양 returned 400 VALIDATION_ERROR even though NEIS returned valid data. Elysia response validation rejected rows missing fields our schema marked as required.

Root cause

NEIS omits many contact/address fields depending on school type:

Field Often missing on
HS_SC_NM non-high schools (already optional)
HS_GNRL_BUSNS_SC_NM some elementary schools (fixed in #11)
SPCLY_PURPS_HS_ORD_NM most schools (already optional)
HMPG_ADRES branch schools (분교장), e.g. 인천계양초등학교상야분교장
ORG_RDNDA special/overseas schools, e.g. 고려대학교사범대학부속중학교
ORG_FAXNO schools under construction, overseas schools
ORG_RDNZC / ORG_RDNMA overseas Korean schools
ENG_SCHUL_NM some domestic schools, kindergartens
FOND_SC_NM rare edge cases

Partial name searches return mixed school types, so one sparse row fails validation for the entire response.

Fix

Make the above NEIS-optional fields optional in SchoolInfoRowSchema and mirror in @timeforschool/client types.

Tests

Added regression coverage for:

  • /school?schoolname=양
  • /school?schoolname=중학

Verification

  • npm run build
  • npm test
  • npm run openapi:sync
  • npm run build:docs
Open in Web Open in Cursor 

NEIS omits contact and address fields on branch schools, overseas
Korean schools, and schools under construction. Partial searches like
양 return mixed result sets, so response validation failed even though
the upstream data was valid.

Make ENG_SCHUL_NM, FOND_SC_NM, ORG_RDNZC, ORG_RDNMA, ORG_RDNDA,
HMPG_ADRES, and ORG_FAXNO optional. Add regression tests for 양 and
중학 searches.

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 Ready Ready Preview, Comment Jun 12, 2026 6:23am
school-api-docs Ready Ready Preview, Comment Jun 12, 2026 6:23am

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