Skip to content

The /v1/onet router queries core.onet_* — the O*NET data is in the onet schema #656

Closed

Description

@thinkclay

Reproduce

GET /v1/onet/occupations/{onetCode}/skills
{"error":"Failed to fetch skills","message":"Could not find the table 'core.onet_skills' in the schema cache"}

Cause

routes/onet.ts reads five references that do not exist:

line queried actual
83, 154, 214, 338 core.onet_occupations onet.occupation_data
266 core.onet_skills onet.skills

The data is seeded and substantial — the onet schema holds 40 tables (occupation_data, skills, abilities, knowledge, work_activities, job_zones, alternate_titles, …). The API simply addresses the wrong schema, so none of it is reachable.

This matters beyond the O*NET router: occupation codes are what the skills taxonomy normalises against (lib/skill-lookups.ts handles onet as a taxonomy alongside csi).

Acceptance

  • Every .from() in onet.ts names the onet schema and a table that exists
  • GET /v1/onet/occupations/{code}/skills returns real rows for a seeded O*NET code
  • GET /v1/onet/search and /autocomplete return results (they currently 400 only because a query param is required — confirm they work once the schema is right)
  • The column names are checked against onet.occupation_data, not assumed from the old core.onet_occupations shape

Found by the runtime sweep behind #651.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions